SWDEV-477218 - Implement hipDeviceGetTexture1DLinearMaxWidth

Change-Id: I8103f710abeb869f5f84be61c57a30b24356def6


[ROCm/clr commit: 8be00b6602]
这个提交包含在:
victzhan 编写, Victor Zhang 于 2024-09-05 15:09:38 -04:00 提交
1 父节点 fde29b7c06
当前提交 11632a954a
7 个文件已更改
+50 -3

没有与搜索条件相匹配的文件

@@ -614,6 +614,24 @@ hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config) {
HIP_RETURN(hipSuccess);
}
hipError_t hipDeviceGetTexture1DLinearMaxWidth(size_t* maxWidthInElements,
const hipChannelFormatDesc* fmtDesc, int device) {
HIP_INIT_API(hipDeviceGetTexture1DLinearMaxWidth, maxWidthInElements, fmtDesc, device);
if (maxWidthInElements == nullptr || fmtDesc == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
hipDeviceProp_tR0600 prop = {0};
HIP_RETURN_ONFAIL(ihipGetDeviceProperties(&prop, device));
// Calculate element size according to fmtDesc
size_t elementSize = (fmtDesc->x + fmtDesc->y
+ fmtDesc->z + fmtDesc->w) / 8; // Convert from bits to bytes
if (elementSize == 0) {
HIP_RETURN(hipErrorInvalidValue);
}
*maxWidthInElements = prop.maxTexture1DLinear / elementSize;
HIP_RETURN(hipSuccess);
}
hipError_t hipDeviceSynchronize() {
HIP_INIT_API(hipDeviceSynchronize);
CHECK_SUPPORTED_DURING_CAPTURE();