diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopyCorners.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopyCorners.cpp index 5189454a05..ce855d0a0a 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopyCorners.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopyCorners.cpp @@ -109,6 +109,7 @@ void OCLPerfImageCopyCorners::open(unsigned int test, char *units, dstBuffer_ = 0; srcImage_ = false; dstImage_ = false; + skip_ = false; error_ = _wrapper->clGetPlatformIDs(0, NULL, &numPlatforms); CHECK_RESULT(error_ != CL_SUCCESS, "clGetPlatformIDs failed"); @@ -172,6 +173,15 @@ void OCLPerfImageCopyCorners::open(unsigned int test, char *units, CHECK_RESULT(_deviceId >= num_devices, "Requested deviceID not available"); device = devices[_deviceId]; + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } if (_openTest % NUM_SIZES) { error_ = _wrapper->clGetDeviceInfo(device, CL_DEVICE_IMAGE2D_MAX_WIDTH, @@ -252,6 +262,9 @@ void OCLPerfImageCopyCorners::open(unsigned int test, char *units, } void OCLPerfImageCopyCorners::run(void) { + if (skip_) { + return; + } size_t origin[3] = {0, 0, 0}; size_t region[3] = {bufSizeW_, bufSizeH_, 1}; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopyCorners.h b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopyCorners.h index 3efda45858..f56591e3b0 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopyCorners.h +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopyCorners.h @@ -41,6 +41,7 @@ class OCLPerfImageCopyCorners : public OCLTestImp { cl_mem srcBuffer_; cl_mem dstBuffer_; cl_int error_; + bool skip_; unsigned int bufSizeW_; unsigned int bufSizeH_; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopySpeed.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopySpeed.cpp index ad2067e757..699142d2e3 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopySpeed.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopySpeed.cpp @@ -97,7 +97,7 @@ void OCLPerfImageCopySpeed::open(unsigned int test, char *units, dstBuffer_ = 0; srcImage_ = false; dstImage_ = false; - + skip_ = false; error_ = _wrapper->clGetPlatformIDs(0, NULL, &numPlatforms); CHECK_RESULT(error_ != CL_SUCCESS, "clGetPlatformIDs failed"); if (0 < numPlatforms) { @@ -161,7 +161,15 @@ void OCLPerfImageCopySpeed::open(unsigned int test, char *units, CHECK_RESULT(_deviceId >= num_devices, "Requested deviceID not available"); device = devices[_deviceId]; - + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } context_ = _wrapper->clCreateContext(NULL, 1, &device, notify_callback, NULL, &error_); CHECK_RESULT(context_ == 0, "clCreateContext failed"); @@ -229,6 +237,9 @@ void OCLPerfImageCopySpeed::open(unsigned int test, char *units, } void OCLPerfImageCopySpeed::run(void) { + if (skip_) { + return; + } size_t origin[3] = {0, 0, 0}; size_t region[3] = {bufSize_, bufSize_, 1}; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopySpeed.h b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopySpeed.h index 39678b2d44..0c04bf9e0a 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopySpeed.h +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCopySpeed.h @@ -41,7 +41,7 @@ class OCLPerfImageCopySpeed : public OCLTestImp { cl_mem srcBuffer_; cl_mem dstBuffer_; cl_int error_; - + bool skip_; unsigned int bufSize_; unsigned int bufnum_; bool srcImage_; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCreate.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCreate.cpp index d16f2a8bc2..57d9f0ee53 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCreate.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageCreate.cpp @@ -107,7 +107,15 @@ void OCLPerfImageCreate::open(unsigned int test, char *units, return; } delete strVersion; - + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } bufSize_ = Sizes[test % NUM_SIZES]; bufnum_ = (test / NUM_SIZES) % NUM_FORMATS; memSize = bufSize_ * bufSize_ * formatSize[bufnum_]; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageMapUnmap.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageMapUnmap.cpp index ff0eb06e90..cc22ea7740 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageMapUnmap.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageMapUnmap.cpp @@ -95,7 +95,7 @@ void OCLPerfImageMapUnmap::open(unsigned int test, char *units, conversion = 1.0f; _deviceId = deviceId; _openTest = test; - + skip_ = false; context_ = 0; cmd_queue_ = 0; srcBuffer_ = 0; @@ -162,6 +162,15 @@ void OCLPerfImageMapUnmap::open(unsigned int test, char *units, CHECK_RESULT(_deviceId >= num_devices, "Requested deviceID not available"); device = devices[_deviceId]; + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } bufSizeW_ = Sizes0[0]; bufSizeH_ = Sizes0[1]; @@ -249,6 +258,9 @@ void OCLPerfImageMapUnmap::open(unsigned int test, char *units, } void OCLPerfImageMapUnmap::run(void) { + if (skip_) { + return; + } size_t origin[3] = {0, 0, 0}; size_t region[3] = {bufSizeW_, bufSizeH_, 1}; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageMapUnmap.h b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageMapUnmap.h index 56e9aa7c45..4d78c09cb1 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageMapUnmap.h +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageMapUnmap.h @@ -41,6 +41,7 @@ class OCLPerfImageMapUnmap : public OCLTestImp { cl_mem srcBuffer_; cl_mem dstBuffer_; cl_int error_; + bool skip_; unsigned int bufSizeW_; unsigned int bufSizeH_; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadSpeed.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadSpeed.cpp index 1130ff0d6c..2780205f6f 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadSpeed.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadSpeed.cpp @@ -67,7 +67,7 @@ void OCLPerfImageReadSpeed::open(unsigned int test, char *units, conversion = 1.0f; _deviceId = deviceId; _openTest = test; - + skip_ = false; context_ = 0; cmd_queue_ = 0; outBuffer_ = 0; @@ -107,7 +107,15 @@ void OCLPerfImageReadSpeed::open(unsigned int test, char *units, CHECK_RESULT(_deviceId >= num_devices, "Requested deviceID not available"); device = devices[_deviceId]; - + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } context_ = _wrapper->clCreateContext(NULL, 1, &device, notify_callback, NULL, &error_); CHECK_RESULT(context_ == 0, "clCreateContext failed"); @@ -123,6 +131,9 @@ void OCLPerfImageReadSpeed::open(unsigned int test, char *units, } void OCLPerfImageReadSpeed::run(void) { + if(skip_) { + return; + } CPerfCounter timer; size_t origin[3] = {0, 0, 0}; size_t region[3] = {bufSize_, bufSize_, 1}; @@ -203,6 +214,7 @@ void OCLPerfPinnedImageReadSpeed::open(unsigned int test, char *units, cmd_queue_ = 0; outBuffer_ = 0; memptr = NULL; + skip_ = false; error_ = _wrapper->clGetPlatformIDs(0, NULL, &numPlatforms); CHECK_RESULT(error_ != CL_SUCCESS, "clGetPlatformIDs failed"); @@ -238,7 +250,15 @@ void OCLPerfPinnedImageReadSpeed::open(unsigned int test, char *units, CHECK_RESULT(_deviceId >= num_devices, "Requested deviceID not available"); device = devices[_deviceId]; - + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } context_ = _wrapper->clCreateContext(NULL, 1, &device, notify_callback, NULL, &error_); CHECK_RESULT(context_ == 0, "clCreateContext failed"); diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadSpeed.h b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadSpeed.h index 30dd13d9fd..d607031f68 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadSpeed.h +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadSpeed.h @@ -40,7 +40,7 @@ class OCLPerfImageReadSpeed : public OCLTestImp { cl_command_queue cmd_queue_; cl_mem outBuffer_; cl_int error_; - + bool skip_; unsigned int bufSize_; unsigned int bufnum_; unsigned int numIter; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadWrite.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadWrite.cpp index 072df4faaf..c069da6231 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadWrite.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadWrite.cpp @@ -123,7 +123,15 @@ void OCLPerfImageReadWrite::open(unsigned int test, char *units, return; } delete strVersion; - + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } bufSize_ = Sizes[test % NUM_SIZES]; bufnum_ = (test / NUM_SIZES) % NUM_FORMATS; memSize = bufSize_ * bufSize_ * formatSize[bufnum_]; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadsRGBA.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadsRGBA.cpp index 1ef6d27598..51748efa37 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadsRGBA.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageReadsRGBA.cpp @@ -126,7 +126,15 @@ void OCLPerfImageReadsRGBA::open(unsigned int test, char *units, return; } delete strVersion; - + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } bufSize_ = Sizes[test % NUM_SIZES]; bufnum_ = (test / NUM_SIZES) % NUM_FORMATS; memSize = bufSize_ * bufSize_ * formatSize[bufnum_]; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageSampleRate.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageSampleRate.cpp index 1979ce319c..cb64b92597 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageSampleRate.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageSampleRate.cpp @@ -134,7 +134,7 @@ void OCLPerfImageSampleRate::open(unsigned int test, char *units, conversion = 1.0f; _deviceId = deviceId; _openTest = test; - + skip_ = false; context_ = 0; cmd_queue_ = 0; program_ = 0; @@ -176,7 +176,15 @@ void OCLPerfImageSampleRate::open(unsigned int test, char *units, CHECK_RESULT(_deviceId >= num_devices, "Requested deviceID not available"); device = devices[_deviceId]; - + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } context_ = _wrapper->clCreateContext(NULL, 1, &device, notify_callback, NULL, &error_); CHECK_RESULT(context_ == 0, "clCreateContext failed"); @@ -247,6 +255,9 @@ void OCLPerfImageSampleRate::open(unsigned int test, char *units, } void OCLPerfImageSampleRate::run(void) { + if (skip_) { + return; + } int global = outBufSize_ / typeSizes[typeIdx_]; int local = 64; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageSampleRate.h b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageSampleRate.h index 0d7743d4a7..a3889ebe87 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageSampleRate.h +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageSampleRate.h @@ -53,6 +53,7 @@ class OCLPerfImageSampleRate : public OCLTestImp { static const unsigned int MAX_ITERATIONS = 25; unsigned int numBufs_; unsigned int typeIdx_; + bool skip_; }; #endif // _OCL_IMAGESAMPLERATE_H_ diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageWriteSpeed.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageWriteSpeed.cpp index 1b31ff31c1..1fbe02de9e 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageWriteSpeed.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageWriteSpeed.cpp @@ -72,7 +72,7 @@ void OCLPerfImageWriteSpeed::open(unsigned int test, char *units, cmd_queue_ = 0; outBuffer_ = 0; memptr = NULL; - + skip_ = false; error_ = _wrapper->clGetPlatformIDs(0, NULL, &numPlatforms); CHECK_RESULT(error_ != CL_SUCCESS, "clGetPlatformIDs failed"); if (0 < numPlatforms) { @@ -128,7 +128,15 @@ void OCLPerfImageWriteSpeed::open(unsigned int test, char *units, CHECK_RESULT(_deviceId >= num_devices, "Requested deviceID not available"); device = devices[_deviceId]; - + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } context_ = _wrapper->clCreateContext(NULL, 1, &device, notify_callback, NULL, &error_); CHECK_RESULT(context_ == 0, "clCreateContext failed"); @@ -144,6 +152,9 @@ void OCLPerfImageWriteSpeed::open(unsigned int test, char *units, } void OCLPerfImageWriteSpeed::run(void) { + if (skip_) { + return; + } CPerfCounter timer; size_t origin[3] = {0, 0, 0}; size_t region[3] = {bufSize_, bufSize_, 1}; @@ -225,7 +236,7 @@ void OCLPerfPinnedImageWriteSpeed::open(unsigned int test, char *units, cmd_queue_ = 0; outBuffer_ = 0; memptr = NULL; - + skip_ = false; error_ = _wrapper->clGetPlatformIDs(0, NULL, &numPlatforms); CHECK_RESULT(error_ != CL_SUCCESS, "clGetPlatformIDs failed"); if (0 < numPlatforms) { @@ -260,7 +271,15 @@ void OCLPerfPinnedImageWriteSpeed::open(unsigned int test, char *units, CHECK_RESULT(_deviceId >= num_devices, "Requested deviceID not available"); device = devices[_deviceId]; - + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } context_ = _wrapper->clCreateContext(NULL, 1, &device, notify_callback, NULL, &error_); CHECK_RESULT(context_ == 0, "clCreateContext failed"); diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageWriteSpeed.h b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageWriteSpeed.h index dacdae4024..3f0f5702c0 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageWriteSpeed.h +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfImageWriteSpeed.h @@ -45,6 +45,7 @@ class OCLPerfImageWriteSpeed : public OCLTestImp { unsigned int bufnum_; unsigned int numIter; char* memptr; + bool skip_; }; class OCLPerfPinnedImageWriteSpeed : public OCLPerfImageWriteSpeed { diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageReadSpeed.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageReadSpeed.cpp index 3beab1ca48..239680d4f8 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageReadSpeed.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageReadSpeed.cpp @@ -72,7 +72,7 @@ void OCLPerfMapImageReadSpeed::open(unsigned int test, char *units, context_ = 0; cmd_queue_ = 0; outBuffer_ = 0; - + skip_ = false; error_ = _wrapper->clGetPlatformIDs(0, NULL, &numPlatforms); CHECK_RESULT(error_ != CL_SUCCESS, "clGetPlatformIDs failed"); if (0 < numPlatforms) { @@ -129,6 +129,15 @@ void OCLPerfMapImageReadSpeed::open(unsigned int test, char *units, CHECK_RESULT(_deviceId >= num_devices, "Requested deviceID not available"); device = devices[_deviceId]; + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } context_ = _wrapper->clCreateContext(NULL, 1, &device, notify_callback, NULL, &error_); CHECK_RESULT(context_ == 0, "clCreateContext failed"); @@ -143,6 +152,9 @@ void OCLPerfMapImageReadSpeed::open(unsigned int test, char *units, } void OCLPerfMapImageReadSpeed::run(void) { + if(skip_) { + return; + } CPerfCounter timer; void *mem; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageReadSpeed.h b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageReadSpeed.h index f44127acec..9902bf2322 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageReadSpeed.h +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageReadSpeed.h @@ -44,6 +44,7 @@ class OCLPerfMapImageReadSpeed : public OCLTestImp { unsigned int bufSize_; unsigned int bufnum_; unsigned int numIter; + bool skip_; }; #endif // _OCL_MapImageReadSpeed_H_ diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageWriteSpeed.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageWriteSpeed.cpp index 9533e40cf4..e4006288e3 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageWriteSpeed.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageWriteSpeed.cpp @@ -73,6 +73,7 @@ void OCLPerfMapImageWriteSpeed::open(unsigned int test, char *units, context_ = 0; cmd_queue_ = 0; outBuffer_ = 0; + skip_ = false; error_ = _wrapper->clGetPlatformIDs(0, NULL, &numPlatforms); CHECK_RESULT(error_ != CL_SUCCESS, "clGetPlatformIDs failed"); @@ -129,7 +130,15 @@ void OCLPerfMapImageWriteSpeed::open(unsigned int test, char *units, CHECK_RESULT(_deviceId >= num_devices, "Requested deviceID not available"); device = devices[_deviceId]; - + size_t size; + bool imageSupport_ = false; + error_ = _wrapper->clGetDeviceInfo(device, CL_DEVICE_IMAGE_SUPPORT, + sizeof(imageSupport_), &imageSupport_, &size); + if (!imageSupport_) { + printf("\n%s\n", "Image not supported, skipping this test!"); + skip_ = true; + return; + } context_ = _wrapper->clCreateContext(NULL, 1, &device, notify_callback, NULL, &error_); CHECK_RESULT(context_ == 0, "clCreateContext failed"); @@ -144,6 +153,9 @@ void OCLPerfMapImageWriteSpeed::open(unsigned int test, char *units, } void OCLPerfMapImageWriteSpeed::run(void) { + if (skip_) { + return; + } CPerfCounter timer; void *mem; diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageWriteSpeed.h b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageWriteSpeed.h index 11aa4314f2..bfb8f0aba3 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageWriteSpeed.h +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMapImageWriteSpeed.h @@ -44,6 +44,7 @@ class OCLPerfMapImageWriteSpeed : public OCLTestImp { unsigned int bufSize_; unsigned int bufnum_; unsigned int numIter; + bool skip_; }; #endif // _OCL_MapImageWriteSpeed_H_