File tree Expand file tree Collapse file tree 7 files changed +36
-24
lines changed Expand file tree Collapse file tree 7 files changed +36
-24
lines changed Original file line number Diff line number Diff line change @@ -2466,8 +2466,8 @@ typedef struct ur_image_desc_t {
24662466 size_t arraySize; ///< [in] image array size
24672467 size_t rowPitch; ///< [in] image row pitch
24682468 size_t slicePitch; ///< [in] image slice pitch
2469- uint32_t numMipLevel; ///< [in] number of MIP levels
2470- uint32_t numSamples; ///< [in] number of samples
2469+ uint32_t numMipLevel; ///< [in] number of MIP levels, must be `0`
2470+ uint32_t numSamples; ///< [in] number of samples, must be `0`
24712471
24722472} ur_image_desc_t;
24732473
@@ -2495,6 +2495,10 @@ typedef struct ur_image_desc_t {
24952495/// - ::UR_RESULT_ERROR_INVALID_VALUE
24962496/// - ::UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR
24972497/// + `pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type`
2498+ /// + `pImageDesc && pImageDesc->numMipLevel != 0`
2499+ /// + `pImageDesc && pImageDesc->numSamples != 0`
2500+ /// + `pImageDesc && pImageDesc->rowPitch != 0 && pHost == nullptr`
2501+ /// + `pImageDesc && pImageDesc->slicePitch != 0 && pHost == nullptr`
24982502/// - ::UR_RESULT_ERROR_INVALID_IMAGE_SIZE
24992503/// - ::UR_RESULT_ERROR_INVALID_OPERATION
25002504/// - ::UR_RESULT_ERROR_INVALID_HOST_PTR
Original file line number Diff line number Diff line change @@ -201,10 +201,10 @@ members:
201201 desc : " [in] image slice pitch"
202202 - type : uint32_t
203203 name : numMipLevel
204- desc : " [in] number of MIP levels"
204+ desc : " [in] number of MIP levels, must be `0` "
205205 - type : uint32_t
206206 name : numSamples
207- desc : " [in] number of samples"
207+ desc : " [in] number of samples, must be `0` "
208208--- # --------------------------------------------------------------------------
209209type : function
210210desc : " Create an image object"
@@ -237,6 +237,10 @@ returns:
237237 - $X_RESULT_ERROR_INVALID_VALUE
238238 - $X_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR :
239239 - " `pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type`"
240+ - " `pImageDesc && pImageDesc->numMipLevel != 0`"
241+ - " `pImageDesc && pImageDesc->numSamples != 0`"
242+ - " `pImageDesc && pImageDesc->rowPitch != 0 && pHost == nullptr`"
243+ - " `pImageDesc && pImageDesc->slicePitch != 0 && pHost == nullptr`"
240244 - $X_RESULT_ERROR_INVALID_IMAGE_SIZE
241245 - $X_RESULT_ERROR_INVALID_OPERATION
242246 - $X_RESULT_ERROR_INVALID_HOST_PTR :
Original file line number Diff line number Diff line change @@ -231,16 +231,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreate(
231231 UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
232232 UR_ASSERT (pImageDesc->type <= UR_MEM_TYPE_IMAGE1D_BUFFER,
233233 UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
234- UR_ASSERT (pImageDesc->numMipLevel == 0 ,
235- UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
236- UR_ASSERT (pImageDesc->numSamples == 0 ,
237- UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
238- if (!pHost) {
239- UR_ASSERT (pImageDesc->rowPitch == 0 ,
240- UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
241- UR_ASSERT (pImageDesc->slicePitch == 0 ,
242- UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
243- }
244234
245235 ur_result_t Result = UR_RESULT_SUCCESS;
246236
Original file line number Diff line number Diff line change @@ -328,16 +328,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreate(
328328 UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
329329 UR_ASSERT (pImageDesc->type <= UR_MEM_TYPE_IMAGE1D_BUFFER,
330330 UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
331- UR_ASSERT (pImageDesc->numMipLevel == 0 ,
332- UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
333- UR_ASSERT (pImageDesc->numSamples == 0 ,
334- UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
335- if (!pHost) {
336- UR_ASSERT (pImageDesc->rowPitch == 0 ,
337- UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
338- UR_ASSERT (pImageDesc->slicePitch == 0 ,
339- UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
340- }
341331
342332 // We only support RBGA channel order
343333 // TODO: check SYCL CTS and spec. May also have to support BGRA
Original file line number Diff line number Diff line change @@ -1012,6 +1012,22 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreate(
10121012 return UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR;
10131013 }
10141014
1015+ if (pImageDesc && pImageDesc->numMipLevel != 0 ) {
1016+ return UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR;
1017+ }
1018+
1019+ if (pImageDesc && pImageDesc->numSamples != 0 ) {
1020+ return UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR;
1021+ }
1022+
1023+ if (pImageDesc && pImageDesc->rowPitch != 0 && pHost == nullptr ) {
1024+ return UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR;
1025+ }
1026+
1027+ if (pImageDesc && pImageDesc->slicePitch != 0 && pHost == nullptr ) {
1028+ return UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR;
1029+ }
1030+
10151031 if (pHost == NULL &&
10161032 (flags & (UR_MEM_FLAG_USE_HOST_POINTER |
10171033 UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER)) != 0 ) {
Original file line number Diff line number Diff line change @@ -1445,6 +1445,10 @@ ur_result_t UR_APICALL urContextSetExtendedDeleter(
14451445// / - ::UR_RESULT_ERROR_INVALID_VALUE
14461446// / - ::UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR
14471447// / + `pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type`
1448+ // / + `pImageDesc && pImageDesc->numMipLevel != 0`
1449+ // / + `pImageDesc && pImageDesc->numSamples != 0`
1450+ // / + `pImageDesc && pImageDesc->rowPitch != 0 && pHost == nullptr`
1451+ // / + `pImageDesc && pImageDesc->slicePitch != 0 && pHost == nullptr`
14481452// / - ::UR_RESULT_ERROR_INVALID_IMAGE_SIZE
14491453// / - ::UR_RESULT_ERROR_INVALID_OPERATION
14501454// / - ::UR_RESULT_ERROR_INVALID_HOST_PTR
Original file line number Diff line number Diff line change @@ -1242,6 +1242,10 @@ ur_result_t UR_APICALL urContextSetExtendedDeleter(
12421242// / - ::UR_RESULT_ERROR_INVALID_VALUE
12431243// / - ::UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR
12441244// / + `pImageDesc && UR_MEM_TYPE_IMAGE1D_BUFFER < pImageDesc->type`
1245+ // / + `pImageDesc && pImageDesc->numMipLevel != 0`
1246+ // / + `pImageDesc && pImageDesc->numSamples != 0`
1247+ // / + `pImageDesc && pImageDesc->rowPitch != 0 && pHost == nullptr`
1248+ // / + `pImageDesc && pImageDesc->slicePitch != 0 && pHost == nullptr`
12451249// / - ::UR_RESULT_ERROR_INVALID_IMAGE_SIZE
12461250// / - ::UR_RESULT_ERROR_INVALID_OPERATION
12471251// / - ::UR_RESULT_ERROR_INVALID_HOST_PTR
You can’t perform that action at this time.
0 commit comments