diff --git a/projects/clr/rocclr/device/devkernel.cpp b/projects/clr/rocclr/device/devkernel.cpp index fdd20a0e37..4bddff1982 100644 --- a/projects/clr/rocclr/device/devkernel.cpp +++ b/projects/clr/rocclr/device/devkernel.cpp @@ -421,8 +421,10 @@ static amd_comgr_status_t populateArgsV3(const amd_comgr_metadata_node_t key, return AMD_COMGR_STATUS_ERROR; } lcArg->accessQualifier_ = itAccQual->second; - lcArg->info_.readOnly_ = + if (!lcArg->info_.isReadOnlyByCompiler) { + lcArg->info_.readOnly_ = (lcArg->accessQualifier_ == CL_KERNEL_ARG_ACCESS_READ_ONLY) ? true : false; + } } break; case ArgField::ActualAccQual: @@ -431,7 +433,9 @@ static amd_comgr_status_t populateArgsV3(const amd_comgr_metadata_node_t key, if (itAccQual == ArgAccQualV3.end()) { return AMD_COMGR_STATUS_ERROR; } - //lcArg->mActualAccQual = itAccQual->second; + lcArg->info_.isReadOnlyByCompiler = true; + lcArg->info_.readOnly_ = + (itAccQual->second == CL_KERNEL_ARG_ACCESS_READ_ONLY) ? true : false; } break; case ArgField::IsConst: @@ -1332,13 +1336,17 @@ void Kernel::InitParameters(const amd_comgr_metadata_node_t kernelMD) { } } - // LC doesn't report correct address qualifier for images and pipes, - // hence overwrite it if ((desc.info_.oclObject_ == amd::KernelParameterDescriptor::ImageObject) || (desc.typeQualifier_ & CL_KERNEL_ARG_TYPE_PIPE)) { + // LC doesn't report correct address qualifier for images and pipes, + // hence overwrite it + // We will remove this when newer LC is ready desc.addressQualifier_ = CL_KERNEL_ARG_ADDRESS_GLOBAL; - + } else { + // According to CL spec, otherwise must be CL_KERNEL_ARG_ACCESS_NONE, + desc.accessQualifier_ = CL_KERNEL_ARG_ACCESS_NONE; } + size_t size = desc.size_; // Allocate the hidden arguments, but abstraction layer will skip them diff --git a/projects/clr/rocclr/device/devkernel.hpp b/projects/clr/rocclr/device/devkernel.hpp index bcc7720ed4..ced898f598 100644 --- a/projects/clr/rocclr/device/devkernel.hpp +++ b/projects/clr/rocclr/device/devkernel.hpp @@ -78,7 +78,7 @@ struct KernelParameterDescriptor { uint32_t defined_ : 1; //!< The argument was defined by the app uint32_t hidden_ : 1; //!< It's a hidden argument uint32_t shared_ : 1; //!< Dynamic shared memory - uint32_t reserved_ : 1; //!< Reserved + uint32_t isReadOnlyByCompiler : 1; //!< Compiler determine it is read only uint32_t arrayIndex_ : 20; //!< Index in the objects array or LDS alignment }; uint32_t allValues_;