From 7efd69cecdbe5e1c4c3843865c17d0b2a95ec1b8 Mon Sep 17 00:00:00 2001 From: jujiang Date: Wed, 6 Oct 2021 16:10:12 -0400 Subject: [PATCH] SWDEV-306207 - clean up CL definition in ROCclr Change-Id: I92e2c7c63ebddd119df390784e372ab2f42f3b0d [ROCm/clr commit: 90b0e8430ae2ef023d4f4bde189d499e1c6bb1ae] --- projects/clr/rocclr/device/device.hpp | 8 ++++---- projects/clr/rocclr/device/gpu/gpudevice.cpp | 16 ++++++++-------- projects/clr/rocclr/device/pal/paldevice.cpp | 16 ++++++++-------- projects/clr/rocclr/device/rocm/rocdevice.cpp | 8 ++++---- projects/clr/rocclr/platform/context.cpp | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/projects/clr/rocclr/device/device.hpp b/projects/clr/rocclr/device/device.hpp index 48f98598a3..b6d9aefde2 100644 --- a/projects/clr/rocclr/device/device.hpp +++ b/projects/clr/rocclr/device/device.hpp @@ -376,8 +376,8 @@ struct Info : public amd::EmbeddedObject { // the device implement error correction. uint32_t errorCorrectionSupport_; - //! CL_TRUE if the device and the host have a unified memory subsystem and - // is CL_FALSE otherwise. + //! true if the device and the host have a unified memory subsystem and + // is false otherwise. uint32_t hostUnifiedMemory_; //! Describes the resolution of device timer. @@ -386,7 +386,7 @@ struct Info : public amd::EmbeddedObject { //! Timer starting point offset to Epoch. uint64_t profilingTimerOffset_; - //! CL_TRUE if device is a little endian device. + //! true if device is a little endian device. uint32_t littleEndian_; //! If enabled, implies that commands can be submitted to command-queues @@ -454,7 +454,7 @@ struct Info : public amd::EmbeddedObject { //! Returns max number of images in a 1D or 2D image array size_t imageMaxArraySize_; - //! Returns CL_TRUE if the devices preference is for the user to be + //! Returns true if the devices preference is for the user to be //! responsible for synchronization uint32_t preferredInteropUserSync_; diff --git a/projects/clr/rocclr/device/gpu/gpudevice.cpp b/projects/clr/rocclr/device/gpu/gpudevice.cpp index 69694207ae..1ff1aae971 100644 --- a/projects/clr/rocclr/device/gpu/gpudevice.cpp +++ b/projects/clr/rocclr/device/gpu/gpudevice.cpp @@ -493,7 +493,7 @@ void NullDevice::fillDeviceInfo(const CALdeviceattribs& calAttr, const gslMemInf // Image support fields if (settings().imageSupport_) { - info_.imageSupport_ = CL_TRUE; + info_.imageSupport_ = true; info_.maxSamplers_ = MaxSamplers; info_.maxReadImageArgs_ = MaxReadImage; info_.maxWriteImageArgs_ = MaxWriteImage; @@ -506,21 +506,21 @@ void NullDevice::fillDeviceInfo(const CALdeviceattribs& calAttr, const gslMemInf info_.imagePitchAlignment_ = 256; // XXX: 256 pixel pitch alignment for now info_.imageBaseAddressAlignment_ = 256; // XXX: 256 byte base address alignment for now - info_.bufferFromImageSupport_ = CL_TRUE; + info_.bufferFromImageSupport_ = true; } - info_.errorCorrectionSupport_ = CL_FALSE; + info_.errorCorrectionSupport_ = false; if (settings().apuSystem_) { - info_.hostUnifiedMemory_ = CL_TRUE; + info_.hostUnifiedMemory_ = true; } info_.profilingTimerResolution_ = 1; info_.profilingTimerOffset_ = amd::Os::offsetToEpochNanos(); - info_.littleEndian_ = CL_TRUE; - info_.available_ = CL_TRUE; - info_.compilerAvailable_ = CL_TRUE; - info_.linkerAvailable_ = CL_TRUE; + info_.littleEndian_ = true; + info_.available_ = true; + info_.compilerAvailable_ = true; + info_.linkerAvailable_ = true; info_.executionCapabilities_ = CL_EXEC_KERNEL; info_.preferredPlatformAtomicAlignment_ = 0; diff --git a/projects/clr/rocclr/device/pal/paldevice.cpp b/projects/clr/rocclr/device/pal/paldevice.cpp index ed8df50880..5c77946d90 100644 --- a/projects/clr/rocclr/device/pal/paldevice.cpp +++ b/projects/clr/rocclr/device/pal/paldevice.cpp @@ -450,7 +450,7 @@ void NullDevice::fillDeviceInfo(const Pal::DeviceProperties& palProp, // Image support fields if (settings().imageSupport_) { - info_.imageSupport_ = CL_TRUE; + info_.imageSupport_ = true; info_.maxSamplers_ = MaxSamplers; info_.maxReadImageArgs_ = MaxReadImage; info_.maxWriteImageArgs_ = MaxWriteImage; @@ -463,21 +463,21 @@ void NullDevice::fillDeviceInfo(const Pal::DeviceProperties& palProp, info_.imagePitchAlignment_ = 256; // PAL uses LINEAR_ALIGNED info_.imageBaseAddressAlignment_ = 256; // XXX: 256 byte base address alignment for now - info_.bufferFromImageSupport_ = CL_TRUE; + info_.bufferFromImageSupport_ = true; } - info_.errorCorrectionSupport_ = CL_FALSE; + info_.errorCorrectionSupport_ = false; if (settings().apuSystem_) { - info_.hostUnifiedMemory_ = CL_TRUE; + info_.hostUnifiedMemory_ = true; } info_.profilingTimerResolution_ = 1; info_.profilingTimerOffset_ = amd::Os::offsetToEpochNanos(); - info_.littleEndian_ = CL_TRUE; - info_.available_ = CL_TRUE; - info_.compilerAvailable_ = CL_TRUE; - info_.linkerAvailable_ = CL_TRUE; + info_.littleEndian_ = true; + info_.available_ = true; + info_.compilerAvailable_ = true; + info_.linkerAvailable_ = true; info_.executionCapabilities_ = CL_EXEC_KERNEL; info_.preferredPlatformAtomicAlignment_ = 0; diff --git a/projects/clr/rocclr/device/rocm/rocdevice.cpp b/projects/clr/rocclr/device/rocm/rocdevice.cpp index c481d5e22b..dc609b45f9 100644 --- a/projects/clr/rocclr/device/rocm/rocdevice.cpp +++ b/projects/clr/rocclr/device/rocm/rocdevice.cpp @@ -1254,7 +1254,7 @@ bool Device::populateOCLDeviceConstants() { if (agent_profile_ == HSA_PROFILE_FULL) { // full-profile = participating in coherent memory, // base-profile = NUMA based non-coherent memory - info_.hostUnifiedMemory_ = CL_TRUE; + info_.hostUnifiedMemory_ = true; } info_.memBaseAddrAlign_ = 8 * (flagIsDefault(MEMOBJ_BASE_ADDR_ALIGN) ? sizeof(int64_t[16]) : MEMOBJ_BASE_ADDR_ALIGN); @@ -1276,7 +1276,7 @@ bool Device::populateOCLDeviceConstants() { info_.addressBits_ = LP64_SWITCH(32, 64); info_.maxSamplers_ = 16; - info_.bufferFromImageSupport_ = CL_FALSE; + info_.bufferFromImageSupport_ = false; info_.oclcVersion_ = "OpenCL C " OPENCL_C_VERSION_STR " "; info_.spirVersions_ = ""; @@ -1413,9 +1413,9 @@ bool Device::populateOCLDeviceConstants() { info_.imageBaseAddressAlignment_ = 256; - info_.bufferFromImageSupport_ = CL_FALSE; + info_.bufferFromImageSupport_ = false; - info_.imageSupport_ = (info_.maxReadWriteImageArgs_ > 0) ? CL_TRUE : CL_FALSE; + info_.imageSupport_ = (info_.maxReadWriteImageArgs_ > 0) ? true : false; } // Enable SVM Capabilities of Hsa device. Ensure diff --git a/projects/clr/rocclr/platform/context.cpp b/projects/clr/rocclr/platform/context.cpp index 50e1eafef3..6fc9bc7f2a 100644 --- a/projects/clr/rocclr/platform/context.cpp +++ b/projects/clr/rocclr/platform/context.cpp @@ -117,7 +117,7 @@ int Context::checkProperties(const cl_context_properties* properties, Context::I while (p->name != 0) { switch (p->name) { case CL_CONTEXT_INTEROP_USER_SYNC: - if (p->ptr == reinterpret_cast(CL_TRUE)) { + if (p->ptr == reinterpret_cast(true)) { info->flags_ |= InteropUserSync; } break;