P4 to Git Change 1472384 by lmoriche@lmoriche_opencl_dev2 on 2017/10/19 03:29:10

SWDEV-126884 - OCL 2.1 Platform APIs
	- Fix OCL/ROCm OpenCL C version

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpucompiler.cpp#157 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#578 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#240 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#65 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#70 edit
... //depot/stg/opencl/drivers/opencl/runtime/runtimedefs#46 edit
This commit is contained in:
foreman
2017-10-19 03:34:06 -04:00
parent 04f538b5e6
commit 46dcd95add
5 changed files with 12 additions and 10 deletions
@@ -138,6 +138,7 @@ bool NullProgram::compileImpl(const std::string& src,
opts << " -cl-std=CL1.1";
break;
case OpenCL20:
case OpenCL21:
default:
case OpenCL12:
opts << " -cl-std=CL1.2";
+4 -4
View File
@@ -216,7 +216,7 @@ bool NullDevice::create(CALtarget target) {
compiler_ = aclCompilerInit(&opts, NULL);
}
if (settings().hsail_ || (settings().oclVersion_ == OpenCL20)) {
if (settings().hsail_ || (settings().oclVersion_ >= OpenCL20)) {
// Runtime doesn't know what local size could be on the real board
info_.maxGlobalVariableSize_ = static_cast<size_t>(512 * Mi);
@@ -487,7 +487,7 @@ void NullDevice::fillDeviceInfo(const CALdeviceattribs& calAttr, const gslMemInf
::snprintf(info_.driverVersion_, sizeof(info_.driverVersion_) - 1, AMD_BUILD_STRING);
info_.profile_ = "FULL_PROFILE";
if (settings().oclVersion_ == OpenCL20) {
if (settings().oclVersion_ >= OpenCL20) {
info_.version_ = "OpenCL 2.0 " AMD_PLATFORM_INFO;
info_.oclcVersion_ = "OpenCL C 2.0 ";
info_.spirVersions_ = "1.2";
@@ -958,7 +958,7 @@ bool Device::create(CALuint ordinal, CALuint numOfDevices) {
compiler_ = aclCompilerInit(&opts, NULL);
}
if (settings().hsail_ || (settings().oclVersion_ == OpenCL20)) {
if (settings().hsail_ || (settings().oclVersion_ >= OpenCL20)) {
if (NULL == hsaCompiler_) {
const char* library = getenv("HSA_COMPILER_LIBRARY");
aclCompilerOptions opts = {
@@ -1068,7 +1068,7 @@ bool Device::initializeHeapResources() {
if (settings().ciPlus_) {
const char* CL20extraBlits = NULL;
const char* ocl20 = NULL;
if (settings().oclVersion_ == OpenCL20) {
if (settings().oclVersion_ >= OpenCL20) {
CL20extraBlits = SchedulerSourceCode;
ocl20 = "-cl-std=CL2.0";
}
+2 -2
View File
@@ -924,7 +924,7 @@ bool Resource::create(MemoryType memType, CreateParams* params) {
}
}
if ((dev().settings().hsail_ || (dev().settings().oclVersion_ == OpenCL20)) && !cal()->buffer_) {
if ((dev().settings().hsail_ || (dev().settings().oclVersion_ >= OpenCL20)) && !cal()->buffer_) {
hwSrd_ = dev().srds().allocSrdSlot(reinterpret_cast<address*>(&hwState_));
if (0 == hwSrd_) {
return false;
@@ -1032,7 +1032,7 @@ void Resource::free() {
}
// Free SRD for images
if ((dev().settings().hsail_ || (dev().settings().oclVersion_ == OpenCL20)) && !cal()->buffer_) {
if ((dev().settings().hsail_ || (dev().settings().oclVersion_ >= OpenCL20)) && !cal()->buffer_) {
dev().srds().freeSrdSlot(hwSrd_);
}
}