From b81816f482fbec99cab337feae7c72fc50792839 Mon Sep 17 00:00:00 2001 From: Laurent Morichetti Date: Thu, 13 Feb 2020 11:24:03 -0800 Subject: [PATCH] Fix build errors for PAL and GSL The last commit to replace the cl_* types with standard types failed to correct issues introduced in the PAL and GPU backend. Change-Id: I926997234dfbe346fc165a7bc4e1b8aabab7bac5 --- rocclr/device/gpu/gpublit.cpp | 18 +++++++++--------- rocclr/device/gpu/gpudevice.cpp | 2 +- rocclr/device/pal/palblit.cpp | 18 +++++++++--------- rocclr/device/pal/palconstbuf.cpp | 2 +- rocclr/device/pal/paldevice.cpp | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/rocclr/device/gpu/gpublit.cpp b/rocclr/device/gpu/gpublit.cpp index 21b9494b02..d08360150e 100644 --- a/rocclr/device/gpu/gpublit.cpp +++ b/rocclr/device/gpu/gpublit.cpp @@ -2206,7 +2206,7 @@ bool KernelBlitManager::fillImage(device::Memory& memory, const void* pattern, dim = 3; void* newpattern = const_cast(pattern); - uint32_t4 iFillColor; + uint32_t iFillColor[4]; bool rejected = false; bool releaseView = false; @@ -2232,11 +2232,11 @@ bool KernelBlitManager::fillImage(device::Memory& memory, const void* pattern, // Converting a linear RGB floating-point color value to a 8-bit unsigned integer sRGB value // because hw is not support write_imagef for sRGB. float* fColor = static_cast(newpattern); - iFillColor.s[0] = sRGBmap(fColor[0]); - iFillColor.s[1] = sRGBmap(fColor[1]); - iFillColor.s[2] = sRGBmap(fColor[2]); - iFillColor.s[3] = (uint32_t)(fColor[3] * 255.0f); - newpattern = static_cast(&iFillColor); + iFillColor[0] = sRGBmap(fColor[0]); + iFillColor[1] = sRGBmap(fColor[1]); + iFillColor[2] = sRGBmap(fColor[2]); + iFillColor[3] = (uint32_t)(fColor[3] * 255.0f); + newpattern = static_cast(&iFillColor[0]); for (uint i = 0; i < RejectedFormatChannelTotal; ++i) { if (RejectedOrder[i].clOldType_ == newFormat.image_channel_order) { newFormat.image_channel_order = RejectedOrder[i].clNewType_; @@ -2281,9 +2281,9 @@ bool KernelBlitManager::fillImage(device::Memory& memory, const void* pattern, // Program kernels arguments for the blit operation Memory* mem = memView; setArgument(kernels_[fillType], 0, sizeof(cl_mem), &mem); - setArgument(kernels_[fillType], 1, sizeof(float4), newpattern); - setArgument(kernels_[fillType], 2, sizeof(int32_t4), newpattern); - setArgument(kernels_[fillType], 3, sizeof(uint32_t4), newpattern); + setArgument(kernels_[fillType], 1, sizeof(float[4]), newpattern); + setArgument(kernels_[fillType], 2, sizeof(int32_t[4]), newpattern); + setArgument(kernels_[fillType], 3, sizeof(uint32_t[4]), newpattern); int32_t fillOrigin[4] = {(int32_t)origin[0], (int32_t)origin[1], (int32_t)origin[2], 0}; int32_t fillSize[4] = {(int32_t)size[0], (int32_t)size[1], (int32_t)size[2], 0}; diff --git a/rocclr/device/gpu/gpudevice.cpp b/rocclr/device/gpu/gpudevice.cpp index 526ff1e041..028bdb9a6a 100644 --- a/rocclr/device/gpu/gpudevice.cpp +++ b/rocclr/device/gpu/gpudevice.cpp @@ -351,7 +351,7 @@ void NullDevice::fillDeviceInfo(const CALdeviceattribs& calAttr, const gslMemInf info_.vramBusBitWidth_ = calAttr.memBusWidth; info_.l2CacheSize_ = 0; info_.maxParameterSize_ = 1024; - info_.minDataTypeAlignSize_ = sizeof(int64_t16); + info_.minDataTypeAlignSize_ = sizeof(int64_t[16]); info_.singleFPConfig_ = CL_FP_ROUND_TO_NEAREST | CL_FP_ROUND_TO_ZERO | CL_FP_ROUND_TO_INF | CL_FP_INF_NAN | CL_FP_FMA; diff --git a/rocclr/device/pal/palblit.cpp b/rocclr/device/pal/palblit.cpp index fca550a227..67fb581b24 100644 --- a/rocclr/device/pal/palblit.cpp +++ b/rocclr/device/pal/palblit.cpp @@ -2232,7 +2232,7 @@ bool KernelBlitManager::fillImage(device::Memory& memory, const void* pattern, dim = 3; void* newpattern = const_cast(pattern); - uint32_t4 iFillColor; + uint32_t iFillColor[4]; bool rejected = false; bool releaseView = false; @@ -2251,11 +2251,11 @@ bool KernelBlitManager::fillImage(device::Memory& memory, const void* pattern, // Converting a linear RGB floating-point color value to a 8-bit unsigned integer sRGB value // because hw is not support write_imagef for sRGB. float* fColor = static_cast(newpattern); - iFillColor.s[0] = sRGBmap(fColor[0]); - iFillColor.s[1] = sRGBmap(fColor[1]); - iFillColor.s[2] = sRGBmap(fColor[2]); - iFillColor.s[3] = (uint32_t)(fColor[3] * 255.0f); - newpattern = static_cast(&iFillColor); + iFillColor[0] = sRGBmap(fColor[0]); + iFillColor[1] = sRGBmap(fColor[1]); + iFillColor[2] = sRGBmap(fColor[2]); + iFillColor[3] = (uint32_t)(fColor[3] * 255.0f); + newpattern = static_cast(&iFillColor[0]); for (uint i = 0; i < RejectedFormatChannelTotal; ++i) { if (RejectedOrder[i].clOldType_ == newFormat.image_channel_order) { newFormat.image_channel_order = RejectedOrder[i].clNewType_; @@ -2308,9 +2308,9 @@ bool KernelBlitManager::fillImage(device::Memory& memory, const void* pattern, // Program kernels arguments for the blit operation Memory* mem = memView; setArgument(kernels_[fillType], 0, sizeof(cl_mem), &mem); - setArgument(kernels_[fillType], 1, sizeof(float4), newpattern); - setArgument(kernels_[fillType], 2, sizeof(int32_t4), newpattern); - setArgument(kernels_[fillType], 3, sizeof(uint32_t4), newpattern); + setArgument(kernels_[fillType], 1, sizeof(float[4]), newpattern); + setArgument(kernels_[fillType], 2, sizeof(int32_t[4]), newpattern); + setArgument(kernels_[fillType], 3, sizeof(uint32_t[4]), newpattern); int32_t fillOrigin[4] = {(int32_t)origin[0], (int32_t)origin[1], (int32_t)origin[2], 0}; int32_t fillSize[4] = {(int32_t)size[0], (int32_t)size[1], (int32_t)size[2], 0}; diff --git a/rocclr/device/pal/palconstbuf.cpp b/rocclr/device/pal/palconstbuf.cpp index 5243e3ff68..8204efb3a3 100644 --- a/rocclr/device/pal/palconstbuf.cpp +++ b/rocclr/device/pal/palconstbuf.cpp @@ -72,7 +72,7 @@ bool ManagedBuffer::create(Resource::MemoryType type) { // ================================================================================================ address ManagedBuffer::reserve(uint32_t size, uint64_t* gpu_address) { // Align to the maximum data size available in OpenCL - static constexpr uint32_t MemAlignment = sizeof(double16); + static constexpr uint32_t MemAlignment = sizeof(double[16]); // Align reserve size on the vector's boundary uint32_t count = amd::alignUp(size, MemAlignment); diff --git a/rocclr/device/pal/paldevice.cpp b/rocclr/device/pal/paldevice.cpp index 570f127906..51094ba944 100644 --- a/rocclr/device/pal/paldevice.cpp +++ b/rocclr/device/pal/paldevice.cpp @@ -400,7 +400,7 @@ void NullDevice::fillDeviceInfo(const Pal::DeviceProperties& palProp, info_.vramBusBitWidth_ = palProp.gpuMemoryProperties.performance.vramBusBitWidth; info_.l2CacheSize_ = palProp.gfxipProperties.shaderCore.tccSizeInBytes; info_.maxParameterSize_ = 1024; - info_.minDataTypeAlignSize_ = sizeof(int64_t16); + info_.minDataTypeAlignSize_ = sizeof(int64_t[16]); info_.singleFPConfig_ = CL_FP_ROUND_TO_NEAREST | CL_FP_ROUND_TO_ZERO | CL_FP_ROUND_TO_INF | CL_FP_INF_NAN | CL_FP_FMA;