Skip to content

Conversation

winstonzhang-intel
Copy link
Contributor

Now urProgramSpcializationConstants will return
UR_RESULT_ERROR_INVALID_SPEC_ID when the incorrect id is used.

Now urProgramSpcializationConstants will return
UR_RESULT_ERROR_INVALID_SPEC_ID when the incorrect id is used.

Signed-off-by: Zhang, Winston <[email protected]>
Signed-off-by: Zhang, Winston <[email protected]>
Signed-off-by: Zhang, Winston <[email protected]>
@@ -994,6 +994,66 @@ ur_result_t urProgramCreateWithNativeHandle(
return UR_RESULT_SUCCESS;
}

// Helper function to validate if a specialization constant ID exists in SPIR-V
static bool isValidSpecConstantId(const uint8_t *spirvCode, size_t spirvSize,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really hesitant to include spir-v parsing in UR. This isn't really the best place for this check. It should be done in the driver, or the compiler needs to provide UR with spec constant ids so the adapter can just check against a known list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants