Created
May 9, 2014 17:00
-
-
Save dwilliamson/1c2e98679526abf1f323 to your computer and use it in GitHub Desktop.
CUDA error lookup with clReflect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const char* cudaGetErrorEnum(cudaError_t error) | |
{ | |
const clcpp::Enum* enum_type = clcpp::GetType<cudaError_t>()->AsEnum(); | |
for (u32 i = 0; i < enum_type->constants.size; i++) | |
{ | |
const clcpp::EnumConstant* constant = enum_type->constants[i]; | |
if (constant->value == error) | |
return constant->name.text; | |
} | |
return "<unknown>"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment