Skip to content

Commit e7de2f6

Browse files
authored
Merge pull request #519 from ThePortlandGroup/nv_stage
Pull 2018-07-01T02-59 Recent NVIDIA Changes
2 parents 1584c8a + d931491 commit e7de2f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4385
-1532
lines changed

runtime/flang/allo.c

Lines changed: 262 additions & 38 deletions
Large diffs are not rendered by default.

runtime/flang/assign.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ static __LOG8_T to_log8(AVAL *);
4646
* error code (typically, a conversion error).
4747
*/
4848
int
49-
__fortio_assign(char *item, /* where to store */
50-
int type, /* data type of item (as in pghpft.h) */
51-
int item_length, /* number of chars if type == __STR */
52-
AVAL *valp /* value to store */
49+
__fortio_assign(char *item, /* where to store */
50+
int type, /* data type of item (as in pghpft.h) */
51+
__CLEN_T item_length, /* number of chars if type == __STR */
52+
AVAL *valp /* value to store */
5353
)
5454
{
55-
int len;
55+
__CLEN_T len;
5656
AVAL *lp;
5757

5858
switch (valp->dtype) {

runtime/flang/close.c

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
2+
* Copyright (c) 2002-2018, NVIDIA CORPORATION. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -90,7 +90,7 @@ __fortio_close(FIO_FCB *f, int flag)
9090

9191
static int
9292
_f90io_close(__INT_T *unit, __INT_T *bitv, __INT_T *iostat, char *status,
93-
int status_siz)
93+
__CLEN_T status_siz)
9494
{
9595
int status_flag;
9696
FIO_FCB *f;
@@ -126,15 +126,15 @@ _f90io_close(__INT_T *unit, __INT_T *bitv, __INT_T *iostat, char *status,
126126
}
127127

128128
__INT_T
129-
ENTF90IO(CLOSE, close)
130-
(__INT_T *unit, __INT_T *bitv, __INT_T *iostat, DCHAR(status) DCLEN(status))
129+
ENTF90IO(CLOSEA, closea)
130+
(__INT_T *unit, __INT_T *bitv, __INT_T *iostat, DCHAR(status) DCLEN64(status))
131131
{
132132
int s = 0;
133133

134134
__fort_status_init(bitv, iostat);
135135
if (LOCAL_MODE || GET_DIST_LCPU == GET_DIST_IOPROC) {
136136
char *p;
137-
int n;
137+
__CLEN_T n;
138138
if (ISPRESENTC(status)) {
139139
p = CADR(status);
140140
n = CLEN(status);
@@ -147,13 +147,21 @@ ENTF90IO(CLOSE, close)
147147
__fortio_errend03();
148148
return DIST_STATUS_BCST(s);
149149
}
150-
150+
/* 32 bit CLEN version */
151151
__INT_T
152-
ENTCRF90IO(CLOSE, close)
152+
ENTF90IO(CLOSE, close)
153153
(__INT_T *unit, __INT_T *bitv, __INT_T *iostat, DCHAR(status) DCLEN(status))
154+
{
155+
return ENTF90IO(CLOSEA, closea) (unit, bitv, iostat, CADR(status),
156+
(__CLEN_T)CLEN(status));
157+
}
158+
159+
__INT_T
160+
ENTCRF90IO(CLOSEA, closea)
161+
(__INT_T *unit, __INT_T *bitv, __INT_T *iostat, DCHAR(status) DCLEN64(status))
154162
{
155163
char *p;
156-
int n;
164+
__CLEN_T n;
157165
int s = 0;
158166

159167
if (ISPRESENTC(status)) {
@@ -167,6 +175,14 @@ ENTCRF90IO(CLOSE, close)
167175
__fortio_errend03();
168176
return s;
169177
}
178+
/* 32 bit CLEN version */
179+
__INT_T
180+
ENTCRF90IO(CLOSE, close)
181+
(__INT_T *unit, __INT_T *bitv, __INT_T *iostat, DCHAR(status) DCLEN(status))
182+
{
183+
return ENTCRF90IO(CLOSEA, closea) (unit, bitv, iostat, CADR(status),
184+
(__CLEN_T)CLEN(status));
185+
}
170186

171187
/** \brief IO cleanup routine */
172188
void

runtime/flang/cshift.c

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
2+
* Copyright (c) 1995-2018, NVIDIA CORPORATION. All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -177,6 +177,21 @@ void ENTFTN(CSHIFTS, cshifts)(void *rb, /* result base */
177177
__fort_frechn(c1);
178178
}
179179

180+
void ENTFTN(CSHIFTSCA, cshiftsca)(DCHAR(rb), /* result char base */
181+
DCHAR(ab), /* array char base */
182+
__INT_T *sb, /* shift base */
183+
__INT_T *db, /* dimension */
184+
F90_Desc *rs, /* result descriptor */
185+
F90_Desc *as, /* array descriptor */
186+
F90_Desc *ss, /* shift descriptor */
187+
F90_Desc *ds /* dim descriptor */
188+
DCLEN64(rb) /* result char len */
189+
DCLEN64(ab)) /* array char len */
190+
{
191+
ENTFTN(CSHIFTS, cshifts)(CADR(rb), CADR(ab), sb, db, rs, as, ss, ds);
192+
}
193+
194+
/* 32 bit CLEN version */
180195
void ENTFTN(CSHIFTSC, cshiftsc)(DCHAR(rb), /* result char base */
181196
DCHAR(ab), /* array char base */
182197
__INT_T *sb, /* shift base */
@@ -188,7 +203,8 @@ void ENTFTN(CSHIFTSC, cshiftsc)(DCHAR(rb), /* result char base */
188203
DCLEN(rb) /* result char len */
189204
DCLEN(ab)) /* array char len */
190205
{
191-
ENTFTN(CSHIFTS, cshifts)(CADR(rb), CADR(ab), sb, db, rs, as, ss, ds);
206+
ENTFTN(CSHIFTSCA, cshiftsca)(CADR(rb), CADR(ab), sb, db, rs, as, ss, ds,
207+
(__CLEN_T)CLEN(rb), (__CLEN_T)CLEN(ab));
192208
}
193209

194210
/* loop over shift array, constructing rank 1 descriptors for each
@@ -440,6 +456,20 @@ void ENTFTN(CSHIFT, cshift)(void *rb, /* result base */
440456
F90_LBASE_G(ss) - 1, F90_RANK_G(ss));
441457
}
442458

459+
void ENTFTN(CSHIFTCA, cshiftca)(DCHAR(rb), /* result char base */
460+
DCHAR(ab), /* array char base */
461+
__INT_T *sb, /* shift base */
462+
__INT_T *db, /* dimension to shift */
463+
F90_Desc *rs, /* result descriptor */
464+
F90_Desc *as, /* array descriptor */
465+
F90_Desc *ss, /* shift descriptor */
466+
F90_Desc *ds /* dim descriptor */
467+
DCLEN64(rb) /* result char len */
468+
DCLEN64(ab)) /* array char len */
469+
{
470+
ENTFTN(CSHIFT, cshift)(CADR(rb), CADR(ab), sb, db, rs, as, ss, ds);
471+
}
472+
443473
void ENTFTN(CSHIFTC, cshiftc)(DCHAR(rb), /* result char base */
444474
DCHAR(ab), /* array char base */
445475
__INT_T *sb, /* shift base */
@@ -451,5 +481,6 @@ void ENTFTN(CSHIFTC, cshiftc)(DCHAR(rb), /* result char base */
451481
DCLEN(rb) /* result char len */
452482
DCLEN(ab)) /* array char len */
453483
{
454-
ENTFTN(CSHIFT, cshift)(CADR(rb), CADR(ab), sb, db, rs, as, ss, ds);
484+
ENTFTN(CSHIFTCA, cshiftca)(CADR(rb), CADR(ab), sb, db, rs, as, ss, ds,
485+
(__CLEN_T)CLEN(rb), (__CLEN_T)CLEN(ab));
455486
}

runtime/flang/dbug.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
void ENTFTN(SET_TEST, set_test)(__INT_T *t) { __fort_test = *t; }
3131
#endif
3232

33-
void ENTFTN(ABORT, abort)(DCHAR(msg), F90_Desc *msg_s DCLEN(msg))
33+
void ENTFTN(ABORTA, aborta)(DCHAR(msg), F90_Desc *msg_s DCLEN64(msg))
3434
{
3535
char ch;
3636
ch = CADR(msg)[CLEN(msg)];
@@ -39,6 +39,12 @@ void ENTFTN(ABORT, abort)(DCHAR(msg), F90_Desc *msg_s DCLEN(msg))
3939
CADR(msg)[CLEN(msg)] = ch;
4040
}
4141

42+
/* 32 bit CLEN version */
43+
void ENTFTN(ABORT, abort)(DCHAR(msg), F90_Desc *msg_s DCLEN(msg))
44+
{
45+
ENTFTN(ABORTA, aborta)(CADR(msg), msg_s, (__CLEN_T)CLEN(msg));
46+
}
47+
4248
#if !defined(DESC_I8)
4349
void
4450
__fort_print_scalar(void *adr, dtype kind)

0 commit comments

Comments
 (0)