Skip to content

Commit ff6180c

Browse files
authored
Switch to SPIRVIntrinsics.jl. (#477)
1 parent 25cf3e0 commit ff6180c

File tree

16 files changed

+52
-1014
lines changed

16 files changed

+52
-1014
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "oneAPI"
22
uuid = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b"
33
authors = ["Tim Besard <tim.besard@gmail.com>"]
4-
version = "1.6.1"
4+
version = "2.0.0"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
@@ -17,6 +17,7 @@ NEO_jll = "700fe977-ac61-5f37-bbc8-c6c4b2b6a9fd"
1717
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
1818
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1919
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
20+
SPIRVIntrinsics = "71d1d633-e7e8-4a92-83a1-de8814b09ba8"
2021
SPIRV_LLVM_Translator_unified_jll = "85f0d8ed-5b39-5caa-b1ae-7472de402361"
2122
SPIRV_Tools_jll = "6ac6d60f-d740-5983-97d7-a4482c0689f4"
2223
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
@@ -36,6 +37,7 @@ KernelAbstractions = "0.9.1"
3637
LLVM = "6, 7, 8, 9"
3738
NEO_jll = "=24.26.30049"
3839
Preferences = "1"
40+
SPIRVIntrinsics = "0.2"
3941
SPIRV_LLVM_Translator_unified_jll = "0.4"
4042
SpecialFunctions = "1.3, 2"
4143
StaticArrays = "1"

src/device/array.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contiguous on-device arrays
22

3-
export oneDeviceArray, oneDeviceVector, oneDeviceMatrix
3+
export oneDeviceArray, oneDeviceVector, oneDeviceMatrix, oneLocalArray
44

55

66
## construction
@@ -240,3 +240,16 @@ function Base.reinterpret(::Type{T}, a::oneDeviceArray{S,N,A}) where {T,S,N,A}
240240
osize = tuple(size1, Base.tail(isize)...)
241241
return oneDeviceArray{T,N,A}(osize, reinterpret(LLVMPtr{T,A}, a.ptr), a.maxsize)
242242
end
243+
244+
245+
## local memory
246+
247+
export oneLocalArray
248+
249+
@inline function oneLocalArray(::Type{T}, dims) where {T}
250+
len = prod(dims)
251+
# NOTE: this relies on const-prop to forward the literal length to the generator.
252+
# maybe we should include the size in the type, like StaticArrays does?
253+
ptr = emit_localmemory(T, Val(len))
254+
oneDeviceArray(dims, ptr)
255+
end

src/device/opencl/atomic.jl

Lines changed: 0 additions & 264 deletions
This file was deleted.

src/device/opencl/integer.jl

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)