Add Max Texture 1D,2D,3D device properties (#1226)
* Add Max Texture 1D,2D,3D device properties
* Corrected testcase to use enums defined in hipDeviceAttribute_t
* Added texture 1D,2D and 3D support for NVIDIA path
[ROCm/hip commit: 8e496c09d9]
This commit is contained in:
@@ -276,6 +276,24 @@ hipError_t ihipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device
|
||||
case hipDeviceAttributeIntegrated:
|
||||
*pi = prop->integrated;
|
||||
break;
|
||||
case hipDeviceAttributeMaxTexture1DWidth:
|
||||
*pi = prop->maxTexture1D;
|
||||
break;
|
||||
case hipDeviceAttributeMaxTexture2DWidth:
|
||||
*pi = prop->maxTexture2D[0];
|
||||
break;
|
||||
case hipDeviceAttributeMaxTexture2DHeight:
|
||||
*pi = prop->maxTexture2D[1];
|
||||
break;
|
||||
case hipDeviceAttributeMaxTexture3DWidth:
|
||||
*pi = prop->maxTexture3D[0];
|
||||
break;
|
||||
case hipDeviceAttributeMaxTexture3DHeight:
|
||||
*pi = prop->maxTexture3D[1];
|
||||
break;
|
||||
case hipDeviceAttributeMaxTexture3DDepth:
|
||||
*pi = prop->maxTexture3D[2];
|
||||
break;
|
||||
default:
|
||||
e = hipErrorInvalidValue;
|
||||
break;
|
||||
|
||||
@@ -43,7 +43,7 @@ THE SOFTWARE.
|
||||
#include <hc.hpp>
|
||||
#include <hc_am.hpp>
|
||||
#include "hsa/hsa_ext_amd.h"
|
||||
|
||||
#include "hsa/hsa_ext_image.h"
|
||||
#include "hip/hip_runtime.h"
|
||||
#include "hip_hcc_internal.h"
|
||||
#include "trace_helper.h"
|
||||
@@ -913,6 +913,18 @@ hipError_t ihipDevice_t::initProperties(hipDeviceProp_t* prop) {
|
||||
if(agent_profile == HSA_PROFILE_FULL) {
|
||||
prop->integrated = 1;
|
||||
}
|
||||
|
||||
err = hsa_agent_get_info(_hsaAgent, (hsa_agent_info_t)HSA_EXT_AGENT_INFO_IMAGE_1D_MAX_ELEMENTS,
|
||||
&prop->maxTexture1D);
|
||||
DeviceErrorCheck(err);
|
||||
|
||||
err = hsa_agent_get_info(_hsaAgent, (hsa_agent_info_t)HSA_EXT_AGENT_INFO_IMAGE_2D_MAX_ELEMENTS,
|
||||
prop->maxTexture2D);
|
||||
DeviceErrorCheck(err);
|
||||
|
||||
err = hsa_agent_get_info(_hsaAgent, (hsa_agent_info_t)HSA_EXT_AGENT_INFO_IMAGE_3D_MAX_ELEMENTS,
|
||||
prop->maxTexture3D);
|
||||
DeviceErrorCheck(err);
|
||||
return e;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user