357
357
cl::unmapSVM(inputB);
358
358
cl::unmapSVM(output2);
359
359
360
- cl_int error;
361
- vectorAddKernel(
360
+ cl_int error;
361
+ vectorAddKernel(
362
362
cl::EnqueueArgs(
363
363
cl::NDRange(numElements/2),
364
364
cl::NDRange(numElements/2)),
369
369
3,
370
370
aPipe,
371
371
defaultDeviceQueue,
372
- error
372
+ error
373
373
);
374
374
375
375
cl::copy(outputBuffer, begin(output), end(output));
@@ -1139,6 +1139,8 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_
1139
1139
F (cl_device_info, CL_DEVICE_MEM_BASE_ADDR_ALIGN, cl_uint) \
1140
1140
F (cl_device_info, CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE, cl_uint) \
1141
1141
F (cl_device_info, CL_DEVICE_SINGLE_FP_CONFIG, cl_device_fp_config) \
1142
+ F (cl_device_info, CL_DEVICE_DOUBLE_FP_CONFIG, cl_device_fp_config) \
1143
+ F (cl_device_info, CL_DEVICE_HALF_FP_CONFIG, cl_device_fp_config) \
1142
1144
F (cl_device_info, CL_DEVICE_GLOBAL_MEM_CACHE_TYPE, cl_device_mem_cache_type) \
1143
1145
F (cl_device_info, CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE, cl_uint)\
1144
1146
F (cl_device_info, CL_DEVICE_GLOBAL_MEM_CACHE_SIZE, cl_ulong) \
@@ -1235,8 +1237,6 @@ inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_
1235
1237
F (cl_device_info, CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT, cl_uint) \
1236
1238
F (cl_device_info, CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE, cl_uint) \
1237
1239
F (cl_device_info, CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF, cl_uint) \
1238
- F (cl_device_info, CL_DEVICE_DOUBLE_FP_CONFIG, cl_device_fp_config) \
1239
- F (cl_device_info, CL_DEVICE_HALF_FP_CONFIG, cl_device_fp_config) \
1240
1240
F (cl_device_info, CL_DEVICE_OPENCL_C_VERSION, string) \
1241
1241
\
1242
1242
F (cl_mem_info, CL_MEM_ASSOCIATED_MEMOBJECT, cl::Memory) \
@@ -1830,8 +1830,6 @@ class Wrapper<cl_device_id>
1830
1830
1831
1831
cl_type get () const { return object_; }
1832
1832
1833
- cl_type get () { return object_; }
1834
-
1835
1833
protected:
1836
1834
template <typename Func, typename U>
1837
1835
friend inline cl_int getInfoHelper (Func, cl_uint, U*, int , typename U::cl_type);
@@ -2744,7 +2742,9 @@ class Context
2744
2742
error = platforms[i].getDevices (type, &devices);
2745
2743
2746
2744
#if defined(CL_HPP_ENABLE_EXCEPTIONS)
2747
- } catch (Error) {}
2745
+ } catch (cl::Error& e) {
2746
+ error = e.err ();
2747
+ }
2748
2748
// Catch if exceptions are enabled as we don't want to exit if first platform has no devices of type
2749
2749
// We do error checking next anyway, and can throw there if needed
2750
2750
#endif
@@ -3069,7 +3069,7 @@ class Event : public detail::Wrapper<cl_event>
3069
3069
*/
3070
3070
cl_int setCallback (
3071
3071
cl_int type,
3072
- void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *),
3072
+ void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *),
3073
3073
void * user_data = NULL)
3074
3074
{
3075
3075
return detail::errHandler (
@@ -3258,7 +3258,7 @@ class Memory : public detail::Wrapper<cl_mem>
3258
3258
* value - not the Memory class instance.
3259
3259
*/
3260
3260
cl_int setDestructorCallback (
3261
- void (CL_CALLBACK * pfn_notify)(cl_mem, void *),
3261
+ void (CL_CALLBACK * pfn_notify)(cl_mem, void *),
3262
3262
void * user_data = NULL)
3263
3263
{
3264
3264
return detail::errHandler (
@@ -3849,7 +3849,7 @@ class Buffer : public Memory
3849
3849
}
3850
3850
3851
3851
return result;
3852
- }
3852
+ }
3853
3853
#endif // CL_HPP_TARGET_OPENCL_VERSION >= 110
3854
3854
};
3855
3855
@@ -4269,7 +4269,7 @@ class Image1D : public Image
4269
4269
{
4270
4270
CL_MEM_OBJECT_IMAGE1D,
4271
4271
width,
4272
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , { 0 }
4272
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
4273
4273
};
4274
4274
object_ = ::clCreateImage (
4275
4275
context (),
@@ -4358,7 +4358,7 @@ class Image1DBuffer : public Image
4358
4358
CL_MEM_OBJECT_IMAGE1D_BUFFER,
4359
4359
width,
4360
4360
0 , 0 , 0 , 0 , 0 , 0 , 0 ,
4361
- { buffer ()}
4361
+ buffer ()
4362
4362
};
4363
4363
object_ = ::clCreateImage (
4364
4364
context (),
@@ -4446,7 +4446,7 @@ class Image1DArray : public Image
4446
4446
0 , 0 , // height, depth (unused)
4447
4447
arraySize,
4448
4448
rowPitch,
4449
- 0 , 0 , 0 , { 0 }
4449
+ 0 , 0 , 0 , 0
4450
4450
};
4451
4451
object_ = ::clCreateImage (
4452
4452
context (),
@@ -4561,7 +4561,7 @@ class Image2D : public Image
4561
4561
height,
4562
4562
0 , 0 , // depth, array size (unused)
4563
4563
row_pitch,
4564
- 0 , 0 , 0 , { 0 }
4564
+ 0 , 0 , 0 , 0
4565
4565
};
4566
4566
object_ = ::clCreateImage (
4567
4567
context (),
@@ -4879,7 +4879,7 @@ class Image2DArray : public Image
4879
4879
arraySize,
4880
4880
rowPitch,
4881
4881
slicePitch,
4882
- 0 , 0 , { 0 }
4882
+ 0 , 0 , 0
4883
4883
};
4884
4884
object_ = ::clCreateImage (
4885
4885
context (),
@@ -4994,7 +4994,7 @@ class Image3D : public Image
4994
4994
0 , // array size (unused)
4995
4995
row_pitch,
4996
4996
slice_pitch,
4997
- 0 , 0 , { 0 }
4997
+ 0 , 0 , 0
4998
4998
};
4999
4999
object_ = ::clCreateImage (
5000
5000
context (),
@@ -5927,27 +5927,28 @@ class Kernel : public detail::Wrapper<cl_kernel>
5927
5927
);
5928
5928
}
5929
5929
5930
- template <int index, int ArrayLength, class D , typename T0, typename ... Ts>
5931
- void setSVMPointersHelper (std::array<void *, ArrayLength> &pointerList, const pointer<T0, D> &t0, Ts ... ts)
5930
+ template <int index, int ArrayLength, class D , typename T0, typename T1, typename ... Ts>
5931
+ void setSVMPointersHelper (std::array<void *, ArrayLength> &pointerList, const pointer<T0, D> &t0, const pointer<T1, D> &t1, Ts & ... ts)
5932
5932
{
5933
5933
pointerList[index ] = static_cast <void *>(t0.get ());
5934
- setSVMPointersHelper<index + 1 , Ts...>( ts...);
5934
+ setSVMPointersHelper<index + 1 , ArrayLength>(pointerList, t1, ts...);
5935
5935
}
5936
5936
5937
- template <int index, int ArrayLength, typename T0, typename ... Ts>
5937
+ template <int index, int ArrayLength, typename T0, typename T1, typename ... Ts>
5938
5938
typename std::enable_if<std::is_pointer<T0>::value, void >::type
5939
- setSVMPointersHelper (std::array<void *, ArrayLength> &pointerList, T0 t0, Ts... ts)
5939
+ setSVMPointersHelper (std::array<void *, ArrayLength> &pointerList, T0 t0, T1 t1, Ts... ts)
5940
5940
{
5941
5941
pointerList[index ] = static_cast <void *>(t0);
5942
- setSVMPointersHelper<index + 1 , Ts...>( ts...);
5942
+ setSVMPointersHelper<index + 1 , ArrayLength>(pointerList, t1, ts...);
5943
5943
}
5944
-
5944
+
5945
5945
template <int index, int ArrayLength, typename T0, class D >
5946
5946
void setSVMPointersHelper (std::array<void *, ArrayLength> &pointerList, const pointer<T0, D> &t0)
5947
5947
{
5948
5948
pointerList[index ] = static_cast <void *>(t0.get ());
5949
5949
}
5950
5950
5951
+
5951
5952
template <int index, int ArrayLength, typename T0>
5952
5953
typename std::enable_if<std::is_pointer<T0>::value, void >::type
5953
5954
setSVMPointersHelper (std::array<void *, ArrayLength> &pointerList, T0 t0)
@@ -5956,7 +5957,7 @@ class Kernel : public detail::Wrapper<cl_kernel>
5956
5957
}
5957
5958
5958
5959
template <typename T0, typename ... Ts>
5959
- cl_int setSVMPointers (const T0 &t0, Ts... ts)
5960
+ cl_int setSVMPointers (const T0 &t0, Ts & ... ts)
5960
5961
{
5961
5962
std::array<void *, 1 + sizeof ...(Ts)> pointerList;
5962
5963
@@ -7208,7 +7209,7 @@ class CommandQueue : public detail::Wrapper<cl_command_queue>
7208
7209
7209
7210
return err;
7210
7211
}
7211
-
7212
+ # if CL_HPP_TARGET_OPENCL_VERSION >= 110
7212
7213
cl_int enqueueReadBufferRect (
7213
7214
const Buffer& buffer,
7214
7215
cl_bool blocking,
@@ -7323,7 +7324,7 @@ class CommandQueue : public detail::Wrapper<cl_command_queue>
7323
7324
7324
7325
return err;
7325
7326
}
7326
-
7327
+ #endif // CL_HPP_TARGET_OPENCL_VERSION >= 110
7327
7328
#if CL_HPP_TARGET_OPENCL_VERSION >= 120
7328
7329
/* *
7329
7330
* Enqueue a command to fill a buffer object with a pattern
@@ -9533,7 +9534,7 @@ class KernelFunctor
9533
9534
}
9534
9535
9535
9536
template <typename T0, typename ... T1s>
9536
- cl_int setSVMPointers (const T0 &t0, T1s... ts)
9537
+ cl_int setSVMPointers (const T0 &t0, T1s & ... ts)
9537
9538
{
9538
9539
return kernel_.setSVMPointers (t0, ts...);
9539
9540
}
@@ -9675,4 +9676,4 @@ namespace compatibility {
9675
9676
9676
9677
} // namespace cl
9677
9678
9678
- #endif // CL_HPP_
9679
+ #endif // CL_HPP_
0 commit comments