Skip to content

Commit 5cff96c

Browse files
committed
Update stream type to i64 and update calls to use stream
1 parent 61405b4 commit 5cff96c

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

flang/include/flang/Runtime/CUDA/allocatable.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,27 @@ namespace Fortran::runtime::cuda {
1717
extern "C" {
1818

1919
/// Perform allocation of the descriptor.
20-
int RTDECL(CUFAllocatableAllocate)(Descriptor &, long stream = -1,
20+
int RTDECL(CUFAllocatableAllocate)(Descriptor &, int64_t stream = -1,
2121
bool hasStat = false, const Descriptor *errMsg = nullptr,
2222
const char *sourceFile = nullptr, int sourceLine = 0);
2323

2424
/// Perform allocation of the descriptor with synchronization of it when
2525
/// necessary.
26-
int RTDECL(CUFAllocatableAllocateSync)(Descriptor &, long stream = -1,
26+
int RTDECL(CUFAllocatableAllocateSync)(Descriptor &, int64_t stream = -1,
2727
bool hasStat = false, const Descriptor *errMsg = nullptr,
2828
const char *sourceFile = nullptr, int sourceLine = 0);
2929

3030
/// Perform allocation of the descriptor without synchronization. Assign data
3131
/// from source.
3232
int RTDEF(CUFAllocatableAllocateSource)(Descriptor &alloc,
33-
const Descriptor &source, long stream = -1, bool hasStat = false,
33+
const Descriptor &source, int64_t stream = -1, bool hasStat = false,
3434
const Descriptor *errMsg = nullptr, const char *sourceFile = nullptr,
3535
int sourceLine = 0);
3636

3737
/// Perform allocation of the descriptor with synchronization of it when
3838
/// necessary. Assign data from source.
3939
int RTDEF(CUFAllocatableAllocateSourceSync)(Descriptor &alloc,
40-
const Descriptor &source, long stream = -1, bool hasStat = false,
40+
const Descriptor &source, int64_t stream = -1, bool hasStat = false,
4141
const Descriptor *errMsg = nullptr, const char *sourceFile = nullptr,
4242
int sourceLine = 0);
4343

flang/runtime/CUDA/allocatable.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ namespace Fortran::runtime::cuda {
2222
extern "C" {
2323
RT_EXT_API_GROUP_BEGIN
2424

25-
int RTDEF(CUFAllocatableAllocate)(Descriptor &desc, long stream, bool hasStat,
26-
const Descriptor *errMsg, const char *sourceFile, int sourceLine) {
25+
int RTDEF(CUFAllocatableAllocateSync)(Descriptor &desc, int64_t stream,
26+
bool hasStat, const Descriptor *errMsg, const char *sourceFile,
27+
int sourceLine) {
2728
int stat{RTNAME(CUFAllocatableAllocate)(
2829
desc, stream, hasStat, errMsg, sourceFile, sourceLine)};
2930
#ifndef RT_DEVICE_COMPILATION
@@ -39,7 +40,7 @@ int RTDEF(CUFAllocatableAllocate)(Descriptor &desc, long stream, bool hasStat,
3940
return stat;
4041
}
4142

42-
int RTDEF(CUFAllocatableAllocateSync)(Descriptor &desc, long stream,
43+
int RTDEF(CUFAllocatableAllocate)(Descriptor &desc, int64_t stream,
4344
bool hasStat, const Descriptor *errMsg, const char *sourceFile,
4445
int sourceLine) {
4546
if (desc.HasAddendum()) {
@@ -56,7 +57,7 @@ int RTDEF(CUFAllocatableAllocateSync)(Descriptor &desc, long stream,
5657
}
5758

5859
int RTDEF(CUFAllocatableAllocateSource)(Descriptor &alloc,
59-
const Descriptor &source, long stream, bool hasStat,
60+
const Descriptor &source, int64_t stream, bool hasStat,
6061
const Descriptor *errMsg, const char *sourceFile, int sourceLine) {
6162
int stat{RTNAME(CUFAllocatableAllocate)(
6263
alloc, stream, hasStat, errMsg, sourceFile, sourceLine)};
@@ -69,10 +70,10 @@ int RTDEF(CUFAllocatableAllocateSource)(Descriptor &alloc,
6970
}
7071

7172
int RTDEF(CUFAllocatableAllocateSourceSync)(Descriptor &alloc,
72-
const Descriptor &source, long stream, bool hasStat,
73+
const Descriptor &source, int64_t stream, bool hasStat,
7374
const Descriptor *errMsg, const char *sourceFile, int sourceLine) {
74-
int stat{RTNAME(AllocatableAllocate)(
75-
alloc, hasStat, errMsg, sourceFile, sourceLine)};
75+
int stat{RTNAME(CUFAllocatableAllocateSync)(
76+
alloc, stream, hasStat, errMsg, sourceFile, sourceLine)};
7677
if (stat == StatOk) {
7778
Terminator terminator{sourceFile, sourceLine};
7879
Fortran::runtime::DoFromSourceAssign(

0 commit comments

Comments
 (0)