Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ck-core/charm.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ extern void CkEnableTracing(int epIdx);
extern void CkCallWhenIdle(int epIdx, void* obj);


#if CMK_CHARM4PY && CMK_CUDA
#if CMK_CHARM4PY
extern void CkHapiAddCallback(long stream, void (*cb)(void*, void*), int fid);
#endif

Expand Down
11 changes: 9 additions & 2 deletions src/ck-core/ck.C
Original file line number Diff line number Diff line change
Expand Up @@ -2638,18 +2638,25 @@ void CkArrayExtSend_multi(int aid, int *idx, int ndims, int epIdx, int num_bufs,
}


// HAPI support
#if CMK_CUDA
#include "hapi.h"
#endif

void CkHapiAddCallback(long stream, void (*cb)(void*, void*), int fid)
{
#if CMK_CUDA
cudaStream_t stream_ptr = (cudaStream_t)stream;
CkCallback callback(cb, (void *) fid);

hapiAddCallback(stream_ptr, callback, NULL);
#else
// function must be defined regardless for cython compilation
CkAbort("CkHapiAddCallback> Charm++ was not built with CUDA support");
#endif
}
#endif // CMK_CUDA

#endif
#endif // CMK_CHARM4PY

//------------------- Message Watcher (record/replay) ----------------

Expand Down