Skip to content

Commit df0fb2b

Browse files
committed
cluda_opencl: cl_khr_fp64 is optional extension/feature
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
1 parent 2e73170 commit df0fb2b

2 files changed

Lines changed: 448 additions & 434 deletions

File tree

src/cluda_opencl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
#define ga_long long
3434
#define ga_ulong ulong
3535
#define ga_float float
36+
#ifdef cl_khr_fp64
37+
#pragma OPENCL EXTENSION cl_khr_fp64: enable
3638
#define ga_double double
39+
#endif
3740
#define ga_size ulong
3841
#define ga_ssize long
3942
#define GA_DECL_SHARED_PARAM(type, name) , __local type *name
@@ -125,10 +128,12 @@ gen_atom32_add(atom_add_fl, ga_float, local)
125128
#define atom_xchg_fg(a, b) atomic_xchg(a, b)
126129
#define atom_xchg_fl(a, b) atomic_xchg(a, b)
127130
/* ga_double */
131+
#ifdef cl_khr_fp64
128132
gen_atom64_add(atom_add_dg, ga_double, global)
129133
gen_atom64_add(atom_add_dl, ga_double, local)
130134
gen_atom64_xchg(atom_xchg_dg, ga_double, global)
131135
gen_atom64_xchg(atom_xchg_dl, ga_double, local)
136+
#endif
132137
/* ga_half */
133138
#define gen_atomh_add(name, aspace) \
134139
ga_half name(volatile aspace ga_half *addr, ga_half val); \

0 commit comments

Comments
 (0)