@@ -39,7 +39,6 @@ def run(self):
3939cmdclass = versioneer .get_cmdclass ()
4040cmdclass ['build_doc' ] = build_doc
4141
42-
4342GCCFLAGS = ["-std=c89" , "-Wdeclaration-after-statement" , "-Werror" ]
4443
4544if os .environ .get ("NUMBA_GCC_FLAGS" ):
@@ -152,6 +151,7 @@ def get_ext_modules():
152151 ** np_compile_args )
153152
154153 ext_npyufunc_workqueue_impls = []
154+ ext_dppy_impls = []
155155
156156 def check_file_at_path (path2file ):
157157 """
@@ -188,8 +188,8 @@ def check_file_at_path(path2file):
188188 tbb_root = check_file_at_path (['include' , 'tbb' , 'tbb.h' ])
189189
190190 # Set various flags for use in TBB and openmp. On OSX, also find OpenMP!
191- have_openmp = False
192- tbb_root = None
191+ have_openmp = True
192+ opeclliteflags = list ()
193193 if sys .platform .startswith ('win' ):
194194 cpp11flags = []
195195 ompcompileflags = ['-openmp' ]
@@ -209,6 +209,7 @@ def check_file_at_path(path2file):
209209 else :
210210 cpp11flags = ['-std=c++11' ]
211211 ompcompileflags = ['-fopenmp' ]
212+ openclliteflags = ['-Wall' , '-Wextra' , '-Winit-self' , '-Wuninitialized' , '-Wmissing-declarations' , '-std=c99' , '-fdiagnostics-color=auto' , '-shared' , '-fPIC' ]
212213 if platform .machine () == 'ppc64le' :
213214 omplinkflags = ['-fopenmp' ]
214215 else :
@@ -239,6 +240,25 @@ def check_file_at_path(path2file):
239240 else :
240241 print ("TBB not found" )
241242
243+ # Search for OpenCL, first check env var OPENCLROOT then conda locations
244+ opencl_root = os .getenv ('OPENCLROOT' )
245+ if not opencl_root :
246+ #opencl_root = check_file_at_path(['include', 'opencl', 'cl.h', "CL.h"])
247+ opencl_root = "/usr"
248+
249+ print ("Building opencllite" )
250+ ext_dppy = Extension (
251+ name = 'numba.dppy.dppy_driver.libdpglue' ,
252+ sources = [
253+ 'numba/dppy/dppy_driver/opencllite.c'
254+ ],
255+ depends = ['numba/dppy/dppy_driver/dp_glue.h' ],
256+ include_dirs = [os .path .join (opencl_root , 'include' )],
257+ extra_compile_args = openclliteflags ,
258+ )
259+ ext_dppy_impls .append (ext_dppy )
260+
261+
242262 # Disable OpenMP if we are building a wheel or
243263 # forced by user with NUMBA_NO_OPENMP=1
244264 if is_building_wheel () or os .getenv ('NUMBA_NO_OPENMP' ):
@@ -297,6 +317,7 @@ def check_file_at_path(path2file):
297317 ext_jitclass_box , ext_cuda_extras ]
298318
299319 ext_modules += ext_npyufunc_workqueue_impls
320+ ext_modules += ext_dppy_impls
300321
301322 return ext_modules
302323
0 commit comments