Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
[weakdeps]
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
oneAPI = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b"

[extensions]
NNopAMDGPUExt = "AMDGPU"
NNopCUDAExt = "CUDA"
NNoponeAPIExt = "oneAPI"

[compat]
AMDGPU = "1.2.5, 2"
Expand Down
11 changes: 11 additions & 0 deletions ext/NNoponeAPIExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module NNoponeAPIExt

using oneAPI
using NNop

function NNop._shared_memory(::oneAPIBackend, device_id::Integer)
dev = oneAPI.devices()[device_id]
return UInt64(oneAPI.compute_properties(dev).maxSharedLocalMemory)
end

end
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Pkg

#ENV["NNOP_TEST_AMDGPU"] = true
#ENV["NNOP_TEST_CUDA"] = true
#ENV["NNOP_TEST_ONEAPI"] = true

if get(ENV, "NNOP_TEST_AMDGPU", "false") == "true"
Pkg.add("AMDGPU")
Expand All @@ -18,6 +19,10 @@ elseif get(ENV, "NNOP_TEST_CUDA", "false") == "true"
Pkg.add("CUDA")
using CUDA
kab = CUDABackend()
elseif get(ENV, "NNOP_TEST_ONEAPI", "false") == "true"
Pkg.add("oneAPI")
using oneAPI
kab = oneAPIBackend()
else
error("No GPU backend is set.")
end
Expand Down