[flang][cuda] Fix signatures after argument change (#138081)
This commit is contained in:
committed by
GitHub
parent
53c175ceaf
commit
16f01b3777
@@ -23,7 +23,7 @@ namespace Fortran::runtime::cuda {
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
RT_EXT_API_GROUP_BEGIN
|
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,
|
bool *pinned, bool hasStat, const Descriptor *errMsg,
|
||||||
const char *sourceFile, int sourceLine) {
|
const char *sourceFile, int sourceLine) {
|
||||||
int stat{RTNAME(CUFAllocatableAllocate)(
|
int stat{RTNAME(CUFAllocatableAllocate)(
|
||||||
@@ -41,7 +41,7 @@ int RTDEF(CUFAllocatableAllocateSync)(Descriptor &desc, int64_t stream,
|
|||||||
return stat;
|
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,
|
bool *pinned, bool hasStat, const Descriptor *errMsg,
|
||||||
const char *sourceFile, int sourceLine) {
|
const char *sourceFile, int sourceLine) {
|
||||||
if (desc.HasAddendum()) {
|
if (desc.HasAddendum()) {
|
||||||
@@ -63,7 +63,7 @@ int RTDEF(CUFAllocatableAllocate)(Descriptor &desc, int64_t stream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int RTDEF(CUFAllocatableAllocateSource)(Descriptor &alloc,
|
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) {
|
const Descriptor *errMsg, const char *sourceFile, int sourceLine) {
|
||||||
int stat{RTNAME(CUFAllocatableAllocate)(
|
int stat{RTNAME(CUFAllocatableAllocate)(
|
||||||
alloc, stream, pinned, hasStat, errMsg, sourceFile, sourceLine)};
|
alloc, stream, pinned, hasStat, errMsg, sourceFile, sourceLine)};
|
||||||
@@ -76,7 +76,7 @@ int RTDEF(CUFAllocatableAllocateSource)(Descriptor &alloc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int RTDEF(CUFAllocatableAllocateSourceSync)(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) {
|
const Descriptor *errMsg, const char *sourceFile, int sourceLine) {
|
||||||
int stat{RTNAME(CUFAllocatableAllocateSync)(
|
int stat{RTNAME(CUFAllocatableAllocateSync)(
|
||||||
alloc, stream, pinned, hasStat, errMsg, sourceFile, sourceLine)};
|
alloc, stream, pinned, hasStat, errMsg, sourceFile, sourceLine)};
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ static unsigned findAllocation(void *ptr) {
|
|||||||
return allocNotFound;
|
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};
|
CriticalSection critical{lock};
|
||||||
initAllocations();
|
initAllocations();
|
||||||
if (numDeviceAllocations >= maxDeviceAllocations) {
|
if (numDeviceAllocations >= maxDeviceAllocations) {
|
||||||
@@ -106,7 +106,7 @@ static void insertAllocation(void *ptr, std::size_t size, std::int64_t stream) {
|
|||||||
}
|
}
|
||||||
deviceAllocations[numDeviceAllocations].ptr = ptr;
|
deviceAllocations[numDeviceAllocations].ptr = ptr;
|
||||||
deviceAllocations[numDeviceAllocations].size = size;
|
deviceAllocations[numDeviceAllocations].size = size;
|
||||||
deviceAllocations[numDeviceAllocations].stream = (cudaStream_t)stream;
|
deviceAllocations[numDeviceAllocations].stream = stream;
|
||||||
++numDeviceAllocations;
|
++numDeviceAllocations;
|
||||||
qsort(deviceAllocations, numDeviceAllocations, sizeof(DeviceAllocation),
|
qsort(deviceAllocations, numDeviceAllocations, sizeof(DeviceAllocation),
|
||||||
compareDeviceAlloc);
|
compareDeviceAlloc);
|
||||||
|
|||||||
@@ -20,16 +20,16 @@ extern "C" {
|
|||||||
void RTDECL(CUFRegisterAllocator)();
|
void RTDECL(CUFRegisterAllocator)();
|
||||||
}
|
}
|
||||||
|
|
||||||
void *CUFAllocPinned(std::size_t, std::int64_t);
|
void *CUFAllocPinned(std::size_t, std::int64_t*);
|
||||||
void CUFFreePinned(void *);
|
void CUFFreePinned(void *);
|
||||||
|
|
||||||
void *CUFAllocDevice(std::size_t, std::int64_t);
|
void *CUFAllocDevice(std::size_t, std::int64_t*);
|
||||||
void CUFFreeDevice(void *);
|
void CUFFreeDevice(void *);
|
||||||
|
|
||||||
void *CUFAllocManaged(std::size_t, std::int64_t);
|
void *CUFAllocManaged(std::size_t, std::int64_t*);
|
||||||
void CUFFreeManaged(void *);
|
void CUFFreeManaged(void *);
|
||||||
|
|
||||||
void *CUFAllocUnified(std::size_t, std::int64_t);
|
void *CUFAllocUnified(std::size_t, std::int64_t*);
|
||||||
void CUFFreeUnified(void *);
|
void CUFFreeUnified(void *);
|
||||||
|
|
||||||
} // namespace Fortran::runtime::cuda
|
} // namespace Fortran::runtime::cuda
|
||||||
|
|||||||
Reference in New Issue
Block a user