-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathSPIRVIntrinsics.jl
53 lines (40 loc) · 1.15 KB
/
SPIRVIntrinsics.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
module SPIRVIntrinsics
using LLVM, LLVM.Interop
using Core: LLVMPtr
import ExprTools
import SpecialFunctions
using GPUToolbox
include("pointer.jl")
include("utils.jl")
# OpenCL intrinsics
#
# we currently don't implement SPIR-V intrinsics directly, but rely on
# the SPIR-V to LLVM translator supporting OpenCL intrinsics
include("work_item.jl")
include("synchronization.jl")
include("memory.jl")
include("printf.jl")
include("math.jl")
include("integer.jl")
include("atomic.jl")
# helper macro to import all names from this package, even non-exported ones.
macro import_all()
code = quote end
for name in names(SPIRVIntrinsics; all=true)
# bring all the names of this module in scope
name in (:SPIRVIntrinsics, :eval, :include) && continue
startswith(string(name), "#") && continue
push!(code.args, :(using .SPIRVIntrinsics: $name))
end
return code
end
# helper macro to re-export public names from this package
macro reexport_public()
code = quote end
for name in names(SPIRVIntrinsics)
name == :SPIRVIntrinsics && continue
push!(code.args, :(export $name))
end
return code
end
end