1 # Math functions not yet available in the libc project, or those not yet tuned
2 # for GPU workloads are provided as wrappers over vendor libraries. If we find
3 # them ahead of time we will import them statically. Otherwise, we will keep
4 # them as external references and expect them to be resolved by the user when
5 # they compile. In the future,we will use implementations from the 'libc'
6 # project and not provide these wrappers.
7 add_subdirectory(vendor)
9 # For the GPU we want to be able to optionally depend on the vendor libraries
10 # until we have a suitable replacement inside `libc`.
11 # TODO: We should have an option to enable or disable these on a per-function
13 option(LIBC_GPU_VENDOR_MATH "Use vendor wrappers for GPU math" ON)
14 function(add_math_entrypoint_gpu_object name)
15 get_fq_target_name("vendor.${name}" fq_vendor_specific_target_name)
16 if(TARGET ${fq_vendor_specific_target_name} AND ${LIBC_GPU_VENDOR_MATH})
20 add_entrypoint_object(
26 add_math_entrypoint_gpu_object(
36 add_math_entrypoint_gpu_object(
46 add_math_entrypoint_gpu_object(
56 add_math_entrypoint_gpu_object(
66 add_math_entrypoint_gpu_object(
76 add_math_entrypoint_gpu_object(
86 add_math_entrypoint_gpu_object(
96 add_math_entrypoint_gpu_object(
106 add_math_entrypoint_gpu_object(
116 add_math_entrypoint_gpu_object(
126 add_math_entrypoint_gpu_object(
136 add_math_entrypoint_gpu_object(
146 add_math_entrypoint_gpu_object(
156 add_math_entrypoint_gpu_object(
166 add_math_entrypoint_gpu_object(
176 add_math_entrypoint_gpu_object(
186 add_math_entrypoint_gpu_object(
196 add_math_entrypoint_gpu_object(
206 add_math_entrypoint_gpu_object(
216 add_math_entrypoint_gpu_object(
226 add_math_entrypoint_gpu_object(
236 add_math_entrypoint_gpu_object(
246 add_math_entrypoint_gpu_object(
256 add_math_entrypoint_gpu_object(
266 add_math_entrypoint_gpu_object(
276 add_math_entrypoint_gpu_object(
286 add_math_entrypoint_gpu_object(
296 add_math_entrypoint_gpu_object(
306 add_math_entrypoint_gpu_object(
316 add_math_entrypoint_gpu_object(
326 add_math_entrypoint_gpu_object(
336 add_math_entrypoint_gpu_object(
346 add_math_entrypoint_gpu_object(
356 add_math_entrypoint_gpu_object(
366 add_math_entrypoint_gpu_object(