File tree Expand file tree Collapse file tree 4 files changed +19
-10
lines changed Expand file tree Collapse file tree 4 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const ompd_callbacks_t *TValue::callbacks = NULL;
9
9
ompd_target_type_sizes_t TValue::type_sizes;
10
10
11
11
inline int ompd_sizeof (ompd_target_prim_types_t t) {
12
- return (((int *)&TValue::type_sizes)[(int )t]);
12
+ return (((char *)&TValue::type_sizes)[(int )t]);
13
13
}
14
14
15
15
TType &TTypeFactory::getType (ompd_address_space_context_t *context,
Original file line number Diff line number Diff line change @@ -70,7 +70,11 @@ ompd_process_initialize(ompd_address_space_context_t
70
70
.getValue (ompd_state);
71
71
if (ret != ompd_rc_ok)
72
72
return ret;
73
- *addrhandle = new ompd_address_space_handle_t ;
73
+ ret = callbacks->dmemory_alloc (sizeof (ompd_address_space_handle_t ),
74
+ (void **)(addrhandle));
75
+ if (ret != ompd_rc_ok)
76
+ return ret;
77
+ // *addrhandle = new ompd_address_space_handle_t;
74
78
if (!addrhandle)
75
79
return ompd_rc_error;
76
80
(*addrhandle)->context = context;
@@ -117,8 +121,9 @@ ompd_rc_t ompd_release_address_space_handle(
117
121
if (!addr_handle)
118
122
return ompd_rc_bad_input;
119
123
120
- delete addr_handle;
121
- return ompd_rc_ok;
124
+ ompd_rc_t ret = callbacks->dmemory_free ((void *)(addr_handle));
125
+ // delete addr_handle;
126
+ return ret;
122
127
}
123
128
124
129
#if 0 // no device support yet
@@ -166,7 +171,11 @@ ompd_rc_t ompd_device_initialize (
166
171
continue;
167
172
168
173
if (cuda_ctx == id) {
169
- *addrhandle = new ompd_address_space_handle_t;
174
+ ret = callbacks->dmemory_alloc(sizeof(ompd_address_space_handle_t),
175
+ (void **)(addrhandle));
176
+ if (ret != ompd_rc_ok)
177
+ return ret;
178
+ // *addrhandle = new ompd_address_space_handle_t;
170
179
if (!addrhandle)
171
180
return ompd_rc_error;
172
181
(*addrhandle)->context = context;
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ typedef struct ompd_target_type_sizes_t {
266
266
uint8_t sizeof_long ;
267
267
uint8_t sizeof_long_long ;
268
268
uint8_t sizeof_pointer ;
269
- } ompd_device_type_sizes_t ;
269
+ } ompd_target_type_sizes_t ;
270
270
271
271
/******************************************************************************
272
272
* Debugger callback signatures.
Original file line number Diff line number Diff line change @@ -64,9 +64,6 @@ OMPD_FOREACH_ACCESS(ompd_init_sizeof_member)
64
64
OMPD_FOREACH_SIZEOF (ompd_init_sizeof)
65
65
#undef ompd_init_sizeof
66
66
67
- ompd_dll_locations=ompd_my_dll_locations;
68
- ompd_dll_locations_valid ();
69
-
70
67
const char *ompd_env_var = getenv (" OMP_OMPD" );
71
68
if (ompd_env_var && !strcmp (ompd_env_var, " on" ))
72
69
{
@@ -77,6 +74,9 @@ OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
77
74
}
78
75
79
76
ompd_initialized = 1 ;
77
+ ompd_dll_locations=ompd_my_dll_locations;
78
+ ompd_dll_locations_valid ();
79
+
80
80
}
81
81
82
82
/* void omp_ompd_enable ( void )
@@ -90,7 +90,7 @@ OMPD_FOREACH_SIZEOF(ompd_init_sizeof)
90
90
#endif
91
91
}*/
92
92
93
- void ompd_dll_locations_valid ( void ){
93
+ void __attribute__ ((noinline)) ompd_dll_locations_valid ( void ){
94
94
/* naive way of implementing hard to opt-out empty function
95
95
we might want to use a separate object file? */
96
96
asm (" " );
You can’t perform that action at this time.
0 commit comments