When you look in the OpenCL implementation code you stumble upon two macros one is ‘’‘@check’‘’ define in src/ macros.jl the other one ‘’‘@ocl_func’‘’. @check is responsible for running the clfunc => $(esc(clfunc)), but it is the @ocl_func (in api.jl) macro that will trigger the ccall of the given clfunc. My question how does the clfunc, for example this one: @check api.clGetPlatformIDs(0, C_NULL, nplatforms) (in platforms.jl) is passed to the @ocl_func macro? Is it implicit( because the ocl macro is define in api so every function called with api.will activate the macro (in the example it will be then @ocl_func(clGetPlatformIDs(0, C_NULL, nplatforms)) )? I cannot find the code which is directing this passage. Clarifying this will help me to understand how macros work.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Method forwarding macro | 8 | 4130 | April 21, 2019 | |
Macro for linking Julia fcn to @ccall of C fcn, given names and arg types | 3 | 97 | January 29, 2025 | |
Macro: is it possible to receive an evaluated argument? | 8 | 799 | March 9, 2021 | |
Interpolation using $ with @cfunction in a macro reported as a closure, thus won't work on Apple Silicon | 8 | 758 | June 9, 2022 | |
Macros don't seem to work? | 17 | 2394 | July 28, 2017 |