Skip to content

Commit

Permalink
gpu_api: add dummy gpuStream{Create,Destroy,Synchronize} for host
Browse files Browse the repository at this point in the history
One could actually think about having an actual implementation using
threads, but this will be good enough for now.
  • Loading branch information
germasch committed Sep 22, 2023
1 parent 7ee4ba9 commit b7e3220
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/fortran/gpu_api.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,21 @@ extern "C" int gpuMemcpyAsync(void* dst, const void* src, size_t bytes,
return 0;
}

#elif defined(GTENSOR_DEVICE_HOST)

// dummy implementation, one GPU only
extern "C" int gpuStreamCreate(gt::stream_view::stream_t* pStream) { return 0; }

extern "C" int gpuStreamCreateAsync(gt::stream_view::stream_t* pStream)
{
return 0;
}

extern "C" int gpuStreamDestroy(gt::stream_view::stream_t stream) { return 0; }

extern "C" int gpuStreamSynchronize(gt::stream_view::stream_t stream)
{
return 0;
}

#endif

0 comments on commit b7e3220

Please sign in to comment.