|
|
| 335 |
class Context; |
335 |
class Context; |
| 336 |
class CommandQueue; |
336 |
class CommandQueue; |
| 337 |
class Memory; |
337 |
class Memory; |
|
|
338 |
class Sampler; |
| 339 |
class Kernel; |
| 340 |
class Event; |
| 338 |
|
341 |
|
| 339 |
#if defined(__CL_ENABLE_EXCEPTIONS) |
342 |
#if defined(__CL_ENABLE_EXCEPTIONS) |
| 340 |
#include <exception> |
343 |
#include <exception> |
|
|
| 824 |
static cl_int |
827 |
static cl_int |
| 825 |
get(Functor f, cl_uint name, T* param) |
828 |
get(Functor f, cl_uint name, T* param) |
| 826 |
{ |
829 |
{ |
| 827 |
return f(name, sizeof(T), param, NULL); |
830 |
cl_int ret = f(name, sizeof(T), param, NULL); |
|
|
831 |
fixReferenceCount(param); |
| 832 |
return ret; |
| 828 |
} |
833 |
} |
| 829 |
}; |
834 |
}; |
| 830 |
|
835 |
|
|
|
| 1216 |
{ |
1221 |
{ |
| 1217 |
return ReferenceHandler<cl_type>::release(object_); |
1222 |
return ReferenceHandler<cl_type>::release(object_); |
| 1218 |
} |
1223 |
} |
|
|
1224 |
|
| 1225 |
friend void fixReferenceCount(Context *param); |
| 1226 |
friend void fixReferenceCount(CommandQueue *param); |
| 1227 |
friend void fixReferenceCount(Memory *param); |
| 1228 |
friend void fixReferenceCount(Sampler *param); |
| 1229 |
friend void fixReferenceCount(Program *param); |
| 1230 |
friend void fixReferenceCount(Kernel *param); |
| 1231 |
friend void fixReferenceCount(Event *param); |
| 1219 |
}; |
1232 |
}; |
| 1220 |
|
1233 |
|
| 1221 |
#if defined(__CL_ENABLE_EXCEPTIONS) |
1234 |
#if defined(__CL_ENABLE_EXCEPTIONS) |
|
|
| 7335 |
&event); |
7348 |
&event); |
| 7336 |
|
7349 |
|
| 7337 |
return event; |
7350 |
return event; |
|
|
7351 |
} |
| 7352 |
|
| 7353 |
namespace detail |
| 7354 |
{ |
| 7355 |
#define FIX_REFERENCE_COUNT(T) \ |
| 7356 |
static inline void fixReferenceCount(T *param) \ |
| 7357 |
{ \ |
| 7358 |
param->retain(); \ |
| 7359 |
} |
| 7360 |
template <typename T> inline void fixReferenceCount(T *param) {} |
| 7361 |
FIX_REFERENCE_COUNT(Context); |
| 7362 |
FIX_REFERENCE_COUNT(CommandQueue); |
| 7363 |
FIX_REFERENCE_COUNT(Memory); |
| 7364 |
FIX_REFERENCE_COUNT(Sampler); |
| 7365 |
FIX_REFERENCE_COUNT(Program); |
| 7366 |
FIX_REFERENCE_COUNT(Kernel); |
| 7367 |
FIX_REFERENCE_COUNT(Event); |
| 7368 |
#undef FIX_REFERENCE_COUNT |
| 7338 |
} |
7369 |
} |
| 7339 |
|
7370 |
|
| 7340 |
#undef __ERR_STR |
7371 |
#undef __ERR_STR |