summaryrefslogtreecommitdiff
path: root/libcuda
diff options
context:
space:
mode:
authorJin Wang <[email protected]>2014-09-29 14:26:42 -0400
committerJin Wang <[email protected]>2016-07-05 08:59:56 -0400
commite340759d5d886661722e978912b28cd1259c00ec (patch)
tree1a6454bcb59acd616b491db23e51cd727945e5bd /libcuda
parent0c5684afcd55e8352fe4b05d9c75a54593417b5f (diff)
MOD: Hack warning for cuda device runtime lib function registration
Diffstat (limited to 'libcuda')
-rw-r--r--libcuda/cuda_runtime_api.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc
index bdfc47c..5dc9cc1 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -260,10 +260,20 @@ struct CUctx_st {
{
if( m_code.find(fat_cubin_handle) != m_code.end() ) {
symbol *s = m_code[fat_cubin_handle]->lookup(deviceFun);
- assert( s != NULL );
- function_info *f = s->get_pc();
- assert( f != NULL );
- m_kernel_lookup[hostFun] = f;
+ if(s != NULL) {
+ function_info *f = s->get_pc();
+ assert( f != NULL );
+ m_kernel_lookup[hostFun] = f;
+ }
+ else {
+ m_code[fat_cubin_handle]->dump();
+ printf("Warning: cannot find deviceFun %s\n", deviceFun);
+ m_kernel_lookup[hostFun] = NULL;
+ }
+ // assert( s != NULL );
+ // function_info *f = s->get_pc();
+ // assert( f != NULL );
+ // m_kernel_lookup[hostFun] = f;
} else {
m_kernel_lookup[hostFun] = NULL;
}