rocr: Support different address modes

Support different address modes in X, Y, Z directions

Change-Id: If1db5a8af33c92ddc4b48968c3d8eceb97daea6a


[ROCm/ROCR-Runtime commit: df250a49a5]
This commit is contained in:
taosang2
2024-11-15 17:05:04 -05:00
committed by David Yat Sin
parent 91a28fce54
commit a5de0f048d
19 changed files with 164 additions and 115 deletions
@@ -261,6 +261,27 @@ hsa_status_t hsa_ext_sampler_create(hsa_agent_t agent,
return HSA_STATUS_ERROR_INVALID_AGENT;
}
if (sampler_descriptor == NULL || sampler == NULL) {
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
}
hsa_ext_sampler_descriptor_v2_t sampler_descriptor_v2 = {
sampler_descriptor->coordinate_mode,
sampler_descriptor->filter_mode,
{sampler_descriptor->address_mode,
sampler_descriptor->address_mode, sampler_descriptor->address_mode}
};
return ImageRuntime::instance()->CreateSamplerHandle(agent, sampler_descriptor_v2, *sampler);
CATCH;
}
hsa_status_t hsa_ext_sampler_create_v2(hsa_agent_t agent,
const hsa_ext_sampler_descriptor_v2_t* sampler_descriptor,
hsa_ext_sampler_t* sampler) {
TRY;
if (agent.handle == 0) {
return HSA_STATUS_ERROR_INVALID_AGENT;
}
if (sampler_descriptor == NULL || sampler == NULL) {
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
}
@@ -397,6 +418,8 @@ void LoadImage(core::ImageExtTableInternal* image_api,
image_api->hsa_amd_image_get_info_max_dim_fn = hsa_amd_image_get_info_max_dim;
image_api->hsa_ext_sampler_create_v2_fn = hsa_ext_sampler_create_v2;
*interface_api = hsa_amd_image_create;
}