@@ -98,15 +98,15 @@ static unsigned findAllocation(void *ptr) {
9898 return allocNotFound;
9999}
100100
101- static void insertAllocation (void *ptr, std::size_t size, std:: int64_t stream) {
101+ static void insertAllocation (void *ptr, std::size_t size, cudaStream_t stream) {
102102 CriticalSection critical{lock};
103103 initAllocations ();
104104 if (numDeviceAllocations >= maxDeviceAllocations) {
105105 doubleAllocationArray ();
106106 }
107107 deviceAllocations[numDeviceAllocations].ptr = ptr;
108108 deviceAllocations[numDeviceAllocations].size = size;
109- deviceAllocations[numDeviceAllocations].stream = (cudaStream_t) stream;
109+ deviceAllocations[numDeviceAllocations].stream = stream;
110110 ++numDeviceAllocations;
111111 qsort (deviceAllocations, numDeviceAllocations, sizeof (DeviceAllocation),
112112 compareDeviceAlloc);
@@ -136,26 +136,26 @@ void RTDEF(CUFRegisterAllocator)() {
136136}
137137
138138void *CUFAllocPinned (
139- std::size_t sizeInBytes, [[maybe_unused]] std::int64_t asyncId ) {
139+ std::size_t sizeInBytes, [[maybe_unused]] std::int64_t *asyncObject ) {
140140 void *p;
141141 CUDA_REPORT_IF_ERROR (cudaMallocHost ((void **)&p, sizeInBytes));
142142 return p;
143143}
144144
145145void CUFFreePinned (void *p) { CUDA_REPORT_IF_ERROR (cudaFreeHost (p)); }
146146
147- void *CUFAllocDevice (std::size_t sizeInBytes, std::int64_t asyncId ) {
147+ void *CUFAllocDevice (std::size_t sizeInBytes, std::int64_t *asyncObject ) {
148148 void *p;
149149 if (Fortran::runtime::executionEnvironment.cudaDeviceIsManaged ) {
150150 CUDA_REPORT_IF_ERROR (
151151 cudaMallocManaged ((void **)&p, sizeInBytes, cudaMemAttachGlobal));
152152 } else {
153- if (asyncId == kNoAsyncId ) {
153+ if (asyncObject == kNoAsyncObject ) {
154154 CUDA_REPORT_IF_ERROR (cudaMalloc (&p, sizeInBytes));
155155 } else {
156156 CUDA_REPORT_IF_ERROR (
157- cudaMallocAsync (&p, sizeInBytes, (cudaStream_t)asyncId ));
158- insertAllocation (p, sizeInBytes, asyncId );
157+ cudaMallocAsync (&p, sizeInBytes, (cudaStream_t)*asyncObject ));
158+ insertAllocation (p, sizeInBytes, (cudaStream_t)*asyncObject );
159159 }
160160 }
161161 return p;
@@ -174,7 +174,7 @@ void CUFFreeDevice(void *p) {
174174}
175175
176176void *CUFAllocManaged (
177- std::size_t sizeInBytes, [[maybe_unused]] std::int64_t asyncId ) {
177+ std::size_t sizeInBytes, [[maybe_unused]] std::int64_t *asyncObject ) {
178178 void *p;
179179 CUDA_REPORT_IF_ERROR (
180180 cudaMallocManaged ((void **)&p, sizeInBytes, cudaMemAttachGlobal));
@@ -184,9 +184,9 @@ void *CUFAllocManaged(
184184void CUFFreeManaged (void *p) { CUDA_REPORT_IF_ERROR (cudaFree (p)); }
185185
186186void *CUFAllocUnified (
187- std::size_t sizeInBytes, [[maybe_unused]] std::int64_t asyncId ) {
187+ std::size_t sizeInBytes, [[maybe_unused]] std::int64_t *asyncObject ) {
188188 // Call alloc managed for the time being.
189- return CUFAllocManaged (sizeInBytes, asyncId );
189+ return CUFAllocManaged (sizeInBytes, asyncObject );
190190}
191191
192192void CUFFreeUnified (void *p) {
0 commit comments