# Understand Macro interconnections in OpenCL.jl package

**URL:** <https://discourse.julialang.org/t/understand-macro-interconnections-in-opencl-jl-package/83581>\
**Category:** General Usage\
**Tags:** question, macros\
**Created:** [June 30, 2022, 8:31pm UTC](https://discourse.julialang.org/t/understand-macro-interconnections-in-opencl-jl-package/83581 "2022-06-30T20:31:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ImreMD](https://avatars.discourse-cdn.com/v4/letter/i/43a26b/32.png) [@ImreMD](https://discourse.julialang.org/u/ImreMD)\
**Post date:** [June 30, 2022, 8:31pm UTC](https://discourse.julialang.org/t/understand-macro-interconnections-in-opencl-jl-package/83581/1 "2022-06-30T20:31:43Z")

</div>

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.
