mirror of
https://github.com/augustin64/projet-tipe
synced 2025-01-23 15:16:26 +01:00
Fix memory_management not used in CUDA
This commit is contained in:
parent
63ef37dc56
commit
2d46136609
@ -100,7 +100,7 @@ Memory* free_memory(void* ptr, Memory* mem) {
|
||||
extern "C"
|
||||
#endif
|
||||
void* nalloc(size_t sz) {
|
||||
#if defined(USE_CUDA) || defined(TEST_MEMORY_MANAGEMENT)
|
||||
#if defined(__CUDACC__) || defined(TEST_MEMORY_MANAGEMENT)
|
||||
pthread_mutex_lock(&memory_lock);
|
||||
if (!memory) {
|
||||
// We allocate a new memory block
|
||||
@ -122,7 +122,7 @@ void* nalloc(size_t sz) {
|
||||
extern "C"
|
||||
#endif
|
||||
void gree(void* ptr) {
|
||||
#if defined(USE_CUDA) || defined(TEST_MEMORY_MANAGEMENT)
|
||||
#if defined(__CUDACC__) || defined(TEST_MEMORY_MANAGEMENT)
|
||||
pthread_mutex_lock(&memory_lock);
|
||||
memory = free_memory(ptr, memory);
|
||||
pthread_mutex_unlock(&memory_lock);
|
||||
|
@ -100,7 +100,7 @@ Memory* free_memory(void* ptr, Memory* mem) {
|
||||
extern "C"
|
||||
#endif
|
||||
void* nalloc(size_t sz) {
|
||||
#if defined(USE_CUDA) || defined(TEST_MEMORY_MANAGEMENT)
|
||||
#if defined(__CUDACC__) || defined(TEST_MEMORY_MANAGEMENT)
|
||||
pthread_mutex_lock(&memory_lock);
|
||||
if (!memory) {
|
||||
// We allocate a new memory block
|
||||
@ -122,7 +122,7 @@ void* nalloc(size_t sz) {
|
||||
extern "C"
|
||||
#endif
|
||||
void gree(void* ptr) {
|
||||
#if defined(USE_CUDA) || defined(TEST_MEMORY_MANAGEMENT)
|
||||
#if defined(__CUDACC__) || defined(TEST_MEMORY_MANAGEMENT)
|
||||
pthread_mutex_lock(&memory_lock);
|
||||
memory = free_memory(ptr, memory);
|
||||
pthread_mutex_unlock(&memory_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user