Revert "Correct limit query return type to match spec ABI."
This reverts commit 7826d4ca2d.
Changing the parameter sizes breaks backward ABI.
Change-Id: Iff14b7c11294f0931f36fcfd42fff11a492d4205
Šī revīzija ir iekļauta:
@@ -65,13 +65,13 @@ class ImageLut {
|
||||
|
||||
virtual Swizzle MapSwizzle(hsa_ext_image_channel_order32_t order) const = 0;
|
||||
|
||||
virtual size_t GetMaxWidth(hsa_ext_image_geometry_t geometry) const = 0;
|
||||
virtual uint32_t GetMaxWidth(hsa_ext_image_geometry_t geometry) const = 0;
|
||||
|
||||
virtual size_t GetMaxHeight(hsa_ext_image_geometry_t geometry) const = 0;
|
||||
virtual uint32_t GetMaxHeight(hsa_ext_image_geometry_t geometry) const = 0;
|
||||
|
||||
virtual size_t GetMaxDepth(hsa_ext_image_geometry_t geometry) const = 0;
|
||||
virtual uint32_t GetMaxDepth(hsa_ext_image_geometry_t geometry) const = 0;
|
||||
|
||||
virtual size_t GetMaxArraySize(hsa_ext_image_geometry_t geometry) const = 0;
|
||||
virtual uint32_t GetMaxArraySize(hsa_ext_image_geometry_t geometry) const = 0;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ImageLut);
|
||||
|
||||
@@ -296,8 +296,7 @@ const Swizzle ImageLutKv::kSwizzleLut_[ORDER_COUNT] = {
|
||||
{SEL_Y, SEL_0, SEL_0, SEL_0} // HSA_EXT_IMAGE_CHANNEL_ORDER_DEPTH_STENCIL
|
||||
};
|
||||
|
||||
// Each record contains four values: width, height, depth, array_size.
|
||||
const size_t ImageLutKv::kMaxDimensionLut_[GEOMETRY_COUNT][4] = {
|
||||
const uint32_t ImageLutKv::kMaxDimensionLut_[GEOMETRY_COUNT][4] = {
|
||||
{16384, 1, 1, 1}, // HSA_EXT_IMAGE_GEOMETRY_1D
|
||||
{16384, 16384, 1, 1}, // HSA_EXT_IMAGE_GEOMETRY_2D
|
||||
{16384, 16384, 8192, 1}, // HSA_EXT_IMAGE_GEOMETRY_3D
|
||||
@@ -402,19 +401,19 @@ Swizzle ImageLutKv::MapSwizzle(hsa_ext_image_channel_order32_t order) const {
|
||||
};
|
||||
}
|
||||
|
||||
size_t ImageLutKv::GetMaxWidth(hsa_ext_image_geometry_t geometry) const {
|
||||
uint32_t ImageLutKv::GetMaxWidth(hsa_ext_image_geometry_t geometry) const {
|
||||
return kMaxDimensionLut_[geometry][0];
|
||||
}
|
||||
|
||||
size_t ImageLutKv::GetMaxHeight(hsa_ext_image_geometry_t geometry) const {
|
||||
uint32_t ImageLutKv::GetMaxHeight(hsa_ext_image_geometry_t geometry) const {
|
||||
return kMaxDimensionLut_[geometry][1];
|
||||
}
|
||||
|
||||
size_t ImageLutKv::GetMaxDepth(hsa_ext_image_geometry_t geometry) const {
|
||||
uint32_t ImageLutKv::GetMaxDepth(hsa_ext_image_geometry_t geometry) const {
|
||||
return kMaxDimensionLut_[geometry][2];
|
||||
}
|
||||
|
||||
size_t ImageLutKv::GetMaxArraySize(hsa_ext_image_geometry_t geometry) const {
|
||||
uint32_t ImageLutKv::GetMaxArraySize(hsa_ext_image_geometry_t geometry) const {
|
||||
return kMaxDimensionLut_[geometry][3];
|
||||
}
|
||||
|
||||
|
||||
@@ -61,13 +61,13 @@ class ImageLutKv : public ImageLut {
|
||||
|
||||
virtual Swizzle MapSwizzle(hsa_ext_image_channel_order32_t order) const;
|
||||
|
||||
virtual size_t GetMaxWidth(hsa_ext_image_geometry_t geometry) const;
|
||||
virtual uint32_t GetMaxWidth(hsa_ext_image_geometry_t geometry) const;
|
||||
|
||||
virtual size_t GetMaxHeight(hsa_ext_image_geometry_t geometry) const;
|
||||
virtual uint32_t GetMaxHeight(hsa_ext_image_geometry_t geometry) const;
|
||||
|
||||
virtual size_t GetMaxDepth(hsa_ext_image_geometry_t geometry) const;
|
||||
virtual uint32_t GetMaxDepth(hsa_ext_image_geometry_t geometry) const;
|
||||
|
||||
virtual size_t GetMaxArraySize(hsa_ext_image_geometry_t geometry) const;
|
||||
virtual uint32_t GetMaxArraySize(hsa_ext_image_geometry_t geometry) const;
|
||||
|
||||
uint32_t GetPixelSize(uint8_t data_format, uint8_t data_type) const;
|
||||
|
||||
@@ -84,8 +84,8 @@ class ImageLutKv : public ImageLut {
|
||||
static const Swizzle kSwizzleLut_[ORDER_COUNT];
|
||||
|
||||
// Lookup table of image geometry to max dimension.
|
||||
// Each record contains four values: width, height, depth, array_size.
|
||||
static const size_t kMaxDimensionLut_[GEOMETRY_COUNT][4];
|
||||
// Each record contains four values: widht, height, depth, array_size.
|
||||
static const uint32_t kMaxDimensionLut_[GEOMETRY_COUNT][4];
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ImageLutKv);
|
||||
};
|
||||
|
||||
@@ -73,9 +73,9 @@ class ImageManager {
|
||||
/// and array size of an image geometry.
|
||||
virtual void GetImageInfoMaxDimension(hsa_agent_t component,
|
||||
hsa_ext_image_geometry_t geometry,
|
||||
size_t& width, size_t& height,
|
||||
size_t& depth,
|
||||
size_t& array_size) const = 0;
|
||||
uint32_t& width, uint32_t& height,
|
||||
uint32_t& depth,
|
||||
uint32_t& array_size) const = 0;
|
||||
|
||||
/// @brief Calculate the size and alignment of the backing storage of an
|
||||
/// image.
|
||||
|
||||
@@ -188,9 +188,9 @@ ImageProperty ImageManagerKv::GetImageProperty(
|
||||
|
||||
void ImageManagerKv::GetImageInfoMaxDimension(hsa_agent_t component,
|
||||
hsa_ext_image_geometry_t geometry,
|
||||
size_t& width, size_t& height,
|
||||
size_t& depth,
|
||||
size_t& array_size) const {
|
||||
uint32_t& width, uint32_t& height,
|
||||
uint32_t& depth,
|
||||
uint32_t& array_size) const {
|
||||
width = ImageLut().GetMaxWidth(geometry);
|
||||
height = ImageLut().GetMaxHeight(geometry);
|
||||
depth = ImageLut().GetMaxDepth(geometry);
|
||||
|
||||
@@ -70,9 +70,9 @@ class ImageManagerKv : public ImageManager {
|
||||
/// and array size of an image geometry.
|
||||
virtual void GetImageInfoMaxDimension(hsa_agent_t component,
|
||||
hsa_ext_image_geometry_t geometry,
|
||||
size_t& width, size_t& height,
|
||||
size_t& depth,
|
||||
size_t& array_size) const;
|
||||
uint32_t& width, uint32_t& height,
|
||||
uint32_t& depth,
|
||||
uint32_t& array_size) const;
|
||||
|
||||
/// @brief Calculate the size and alignment of the backing storage of an
|
||||
/// image.
|
||||
|
||||
@@ -203,9 +203,9 @@ void ImageRuntime::DestroySingleton() {
|
||||
hsa_status_t ImageRuntime::GetImageInfoMaxDimension(hsa_agent_t component,
|
||||
hsa_agent_info_t attribute,
|
||||
void* value) {
|
||||
size_t* value_u32 = NULL;
|
||||
size_t* value_u32_v2 = NULL;
|
||||
size_t* value_u32_v3 = NULL;
|
||||
uint32_t* value_u32 = NULL;
|
||||
uint32_t* value_u32_v2 = NULL;
|
||||
uint32_t* value_u32_v3 = NULL;
|
||||
|
||||
hsa_ext_image_geometry_t geometry;
|
||||
|
||||
@@ -213,48 +213,48 @@ hsa_status_t ImageRuntime::GetImageInfoMaxDimension(hsa_agent_t component,
|
||||
switch (image_attribute) {
|
||||
case HSA_EXT_AGENT_INFO_IMAGE_1D_MAX_ELEMENTS:
|
||||
geometry = HSA_EXT_IMAGE_GEOMETRY_1D;
|
||||
value_u32 = static_cast<size_t*>(value);
|
||||
value_u32 = static_cast<uint32_t*>(value);
|
||||
break;
|
||||
case HSA_EXT_AGENT_INFO_IMAGE_1DA_MAX_ELEMENTS:
|
||||
geometry = HSA_EXT_IMAGE_GEOMETRY_1DA;
|
||||
value_u32 = static_cast<size_t*>(value);
|
||||
value_u32 = static_cast<uint32_t*>(value);
|
||||
break;
|
||||
case HSA_EXT_AGENT_INFO_IMAGE_1DB_MAX_ELEMENTS:
|
||||
geometry = HSA_EXT_IMAGE_GEOMETRY_1DB;
|
||||
value_u32 = static_cast<size_t*>(value);
|
||||
value_u32 = static_cast<uint32_t*>(value);
|
||||
break;
|
||||
case HSA_EXT_AGENT_INFO_IMAGE_2D_MAX_ELEMENTS:
|
||||
geometry = HSA_EXT_IMAGE_GEOMETRY_2D;
|
||||
value_u32_v2 = static_cast<size_t*>(value);
|
||||
value_u32_v2 = static_cast<uint32_t*>(value);
|
||||
break;
|
||||
case HSA_EXT_AGENT_INFO_IMAGE_2DA_MAX_ELEMENTS:
|
||||
geometry = HSA_EXT_IMAGE_GEOMETRY_2DA;
|
||||
value_u32_v2 = static_cast<size_t*>(value);
|
||||
value_u32_v2 = static_cast<uint32_t*>(value);
|
||||
break;
|
||||
case HSA_EXT_AGENT_INFO_IMAGE_2DDEPTH_MAX_ELEMENTS:
|
||||
geometry = HSA_EXT_IMAGE_GEOMETRY_2DDEPTH;
|
||||
value_u32_v2 = static_cast<size_t*>(value);
|
||||
value_u32_v2 = static_cast<uint32_t*>(value);
|
||||
break;
|
||||
case HSA_EXT_AGENT_INFO_IMAGE_2DADEPTH_MAX_ELEMENTS:
|
||||
geometry = HSA_EXT_IMAGE_GEOMETRY_2DADEPTH;
|
||||
value_u32_v2 = static_cast<size_t*>(value);
|
||||
value_u32_v2 = static_cast<uint32_t*>(value);
|
||||
break;
|
||||
case HSA_EXT_AGENT_INFO_IMAGE_3D_MAX_ELEMENTS:
|
||||
geometry = HSA_EXT_IMAGE_GEOMETRY_3D;
|
||||
value_u32_v3 = static_cast<size_t*>(value);
|
||||
value_u32_v3 = static_cast<uint32_t*>(value);
|
||||
break;
|
||||
case HSA_EXT_AGENT_INFO_IMAGE_ARRAY_MAX_LAYERS:
|
||||
geometry = HSA_EXT_IMAGE_GEOMETRY_2DA;
|
||||
value_u32 = static_cast<size_t*>(value);
|
||||
value_u32 = static_cast<uint32_t*>(value);
|
||||
break;
|
||||
default:
|
||||
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
size_t width = 0;
|
||||
size_t height = 0;
|
||||
size_t depth = 0;
|
||||
size_t array_size = 0;
|
||||
uint32_t width = 0;
|
||||
uint32_t height = 0;
|
||||
uint32_t depth = 0;
|
||||
uint32_t array_size = 0;
|
||||
|
||||
hsa_device_type_t device_type;
|
||||
hsa_status_t status = HSA::hsa_agent_get_info(component, HSA_AGENT_INFO_DEVICE, &device_type);
|
||||
@@ -327,10 +327,10 @@ hsa_status_t ImageRuntime::GetImageSizeAndAlignment(
|
||||
}
|
||||
|
||||
const hsa_ext_image_geometry_t geometry = desc.geometry;
|
||||
size_t max_width = 0;
|
||||
size_t max_height = 0;
|
||||
size_t max_depth = 0;
|
||||
size_t max_array_size = 0;
|
||||
uint32_t max_width = 0;
|
||||
uint32_t max_height = 0;
|
||||
uint32_t max_depth = 0;
|
||||
uint32_t max_array_size = 0;
|
||||
|
||||
ImageManager* manager = image_manager(component);
|
||||
|
||||
|
||||
Atsaukties uz šo jaunā problēmā
Block a user