SWDEV-383839 - fix oclperf test failures on MI300

Change-Id: I789dad08f875d16eeb4d60dc60379d4ee4158904


[ROCm/clr commit: effb58e076]
This commit is contained in:
Julia Jiang
2023-02-23 18:29:36 -05:00
förälder 562a086ff1
incheckning c8b989d288
19 ändrade filer med 159 tillägg och 19 borttagningar
@@ -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};
@@ -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_;
@@ -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};
@@ -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_;
@@ -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_];
@@ -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};
@@ -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_;
@@ -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");
@@ -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;
@@ -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_];
@@ -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_];
@@ -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;
@@ -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_
@@ -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");
@@ -45,6 +45,7 @@ class OCLPerfImageWriteSpeed : public OCLTestImp {
unsigned int bufnum_;
unsigned int numIter;
char* memptr;
bool skip_;
};
class OCLPerfPinnedImageWriteSpeed : public OCLPerfImageWriteSpeed {
@@ -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;
@@ -44,6 +44,7 @@ class OCLPerfMapImageReadSpeed : public OCLTestImp {
unsigned int bufSize_;
unsigned int bufnum_;
unsigned int numIter;
bool skip_;
};
#endif // _OCL_MapImageReadSpeed_H_
@@ -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;
@@ -44,6 +44,7 @@ class OCLPerfMapImageWriteSpeed : public OCLTestImp {
unsigned int bufSize_;
unsigned int bufnum_;
unsigned int numIter;
bool skip_;
};
#endif // _OCL_MapImageWriteSpeed_H_