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
8 changes: 4 additions & 4 deletions flang-rt/lib/cuda/allocatable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Fortran::runtime::cuda {
extern "C" {
RT_EXT_API_GROUP_BEGIN

int RTDEF(CUFAllocatableAllocateSync)(Descriptor &desc, int64_t stream,
int RTDEF(CUFAllocatableAllocateSync)(Descriptor &desc, int64_t *stream,
bool *pinned, bool hasStat, const Descriptor *errMsg,
const char *sourceFile, int sourceLine) {
int stat{RTNAME(CUFAllocatableAllocate)(
Expand All @@ -41,7 +41,7 @@ int RTDEF(CUFAllocatableAllocateSync)(Descriptor &desc, int64_t stream,
return stat;
}

int RTDEF(CUFAllocatableAllocate)(Descriptor &desc, int64_t stream,
int RTDEF(CUFAllocatableAllocate)(Descriptor &desc, int64_t *stream,
bool *pinned, bool hasStat, const Descriptor *errMsg,
const char *sourceFile, int sourceLine) {
if (desc.HasAddendum()) {
Expand All @@ -63,7 +63,7 @@ int RTDEF(CUFAllocatableAllocate)(Descriptor &desc, int64_t stream,
}

int RTDEF(CUFAllocatableAllocateSource)(Descriptor &alloc,
const Descriptor &source, int64_t stream, bool *pinned, bool hasStat,
const Descriptor &source, int64_t *stream, bool *pinned, bool hasStat,
const Descriptor *errMsg, const char *sourceFile, int sourceLine) {
int stat{RTNAME(CUFAllocatableAllocate)(
alloc, stream, pinned, hasStat, errMsg, sourceFile, sourceLine)};
Expand All @@ -76,7 +76,7 @@ int RTDEF(CUFAllocatableAllocateSource)(Descriptor &alloc,
}

int RTDEF(CUFAllocatableAllocateSourceSync)(Descriptor &alloc,
const Descriptor &source, int64_t stream, bool *pinned, bool hasStat,
const Descriptor &source, int64_t *stream, bool *pinned, bool hasStat,
const Descriptor *errMsg, const char *sourceFile, int sourceLine) {
int stat{RTNAME(CUFAllocatableAllocateSync)(
alloc, stream, pinned, hasStat, errMsg, sourceFile, sourceLine)};
Expand Down
4 changes: 2 additions & 2 deletions flang-rt/lib/cuda/allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ static unsigned findAllocation(void *ptr) {
return allocNotFound;
}

static void insertAllocation(void *ptr, std::size_t size, std::int64_t stream) {
static void insertAllocation(void *ptr, std::size_t size, cudaStream_t stream) {
CriticalSection critical{lock};
initAllocations();
if (numDeviceAllocations >= maxDeviceAllocations) {
doubleAllocationArray();
}
deviceAllocations[numDeviceAllocations].ptr = ptr;
deviceAllocations[numDeviceAllocations].size = size;
deviceAllocations[numDeviceAllocations].stream = (cudaStream_t)stream;
deviceAllocations[numDeviceAllocations].stream = stream;
++numDeviceAllocations;
qsort(deviceAllocations, numDeviceAllocations, sizeof(DeviceAllocation),
compareDeviceAlloc);
Expand Down
8 changes: 4 additions & 4 deletions flang/include/flang/Runtime/CUDA/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ extern "C" {
void RTDECL(CUFRegisterAllocator)();
}

void *CUFAllocPinned(std::size_t, std::int64_t);
void *CUFAllocPinned(std::size_t, std::int64_t*);
void CUFFreePinned(void *);

void *CUFAllocDevice(std::size_t, std::int64_t);
void *CUFAllocDevice(std::size_t, std::int64_t*);
void CUFFreeDevice(void *);

void *CUFAllocManaged(std::size_t, std::int64_t);
void *CUFAllocManaged(std::size_t, std::int64_t*);
void CUFFreeManaged(void *);

void *CUFAllocUnified(std::size_t, std::int64_t);
void *CUFAllocUnified(std::size_t, std::int64_t*);
void CUFFreeUnified(void *);

} // namespace Fortran::runtime::cuda
Expand Down
Loading