Skip to content

Commit 9a8d3c5

Browse files
clementvalGeorgeARM
authored andcommitted
[flang][cuda] Fix signatures after argument change (llvm#138081)
1 parent 38abf33 commit 9a8d3c5

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

flang-rt/lib/cuda/allocatable.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Fortran::runtime::cuda {
2323
extern "C" {
2424
RT_EXT_API_GROUP_BEGIN
2525

26-
int RTDEF(CUFAllocatableAllocateSync)(Descriptor &desc, int64_t stream,
26+
int RTDEF(CUFAllocatableAllocateSync)(Descriptor &desc, int64_t *stream,
2727
bool *pinned, bool hasStat, const Descriptor *errMsg,
2828
const char *sourceFile, int sourceLine) {
2929
int stat{RTNAME(CUFAllocatableAllocate)(
@@ -41,7 +41,7 @@ int RTDEF(CUFAllocatableAllocateSync)(Descriptor &desc, int64_t stream,
4141
return stat;
4242
}
4343

44-
int RTDEF(CUFAllocatableAllocate)(Descriptor &desc, int64_t stream,
44+
int RTDEF(CUFAllocatableAllocate)(Descriptor &desc, int64_t *stream,
4545
bool *pinned, bool hasStat, const Descriptor *errMsg,
4646
const char *sourceFile, int sourceLine) {
4747
if (desc.HasAddendum()) {
@@ -63,7 +63,7 @@ int RTDEF(CUFAllocatableAllocate)(Descriptor &desc, int64_t stream,
6363
}
6464

6565
int RTDEF(CUFAllocatableAllocateSource)(Descriptor &alloc,
66-
const Descriptor &source, int64_t stream, bool *pinned, bool hasStat,
66+
const Descriptor &source, int64_t *stream, bool *pinned, bool hasStat,
6767
const Descriptor *errMsg, const char *sourceFile, int sourceLine) {
6868
int stat{RTNAME(CUFAllocatableAllocate)(
6969
alloc, stream, pinned, hasStat, errMsg, sourceFile, sourceLine)};
@@ -76,7 +76,7 @@ int RTDEF(CUFAllocatableAllocateSource)(Descriptor &alloc,
7676
}
7777

7878
int RTDEF(CUFAllocatableAllocateSourceSync)(Descriptor &alloc,
79-
const Descriptor &source, int64_t stream, bool *pinned, bool hasStat,
79+
const Descriptor &source, int64_t *stream, bool *pinned, bool hasStat,
8080
const Descriptor *errMsg, const char *sourceFile, int sourceLine) {
8181
int stat{RTNAME(CUFAllocatableAllocateSync)(
8282
alloc, stream, pinned, hasStat, errMsg, sourceFile, sourceLine)};

flang-rt/lib/cuda/allocator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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);

flang/include/flang/Runtime/CUDA/allocator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ extern "C" {
2020
void RTDECL(CUFRegisterAllocator)();
2121
}
2222

23-
void *CUFAllocPinned(std::size_t, std::int64_t);
23+
void *CUFAllocPinned(std::size_t, std::int64_t*);
2424
void CUFFreePinned(void *);
2525

26-
void *CUFAllocDevice(std::size_t, std::int64_t);
26+
void *CUFAllocDevice(std::size_t, std::int64_t*);
2727
void CUFFreeDevice(void *);
2828

29-
void *CUFAllocManaged(std::size_t, std::int64_t);
29+
void *CUFAllocManaged(std::size_t, std::int64_t*);
3030
void CUFFreeManaged(void *);
3131

32-
void *CUFAllocUnified(std::size_t, std::int64_t);
32+
void *CUFAllocUnified(std::size_t, std::int64_t*);
3333
void CUFFreeUnified(void *);
3434

3535
} // namespace Fortran::runtime::cuda

0 commit comments

Comments
 (0)