Beispiel #1
0
// get version from string
HGPU_GPU_version
HGPU_GPU_version_get(char* version_str){
    HGPU_GPU_version version;
        version.major = 0;
        version.minor = 0; 
    if (strlen(version_str)< 10) HGPU_GPU_error_message(HGPU_ERROR_BAD_OPENCL_VERSION,"bad OpenCL version");
    char* temp = HGPU_string_clone(version_str);
    HGPU_string_delete_symbols_except_numbers_and_dots(temp);
    HGPU_string_trim(temp);
    sscanf_s(temp,"%d.%d",&version.major,&version.minor);
    free(temp);
    return version;
}
Beispiel #2
0
// set literal name for buffer (for debugging and statistics purposes)
void
HGPU_GPU_buffer_set_name(HGPU_GPU_buffer* buffer,const char* buffer_name){
    if ((!buffer) || (!buffer_name)) return;
    free(buffer->name);
    buffer->name = HGPU_string_clone(buffer_name);
}