Skip to content

Commit 249b986

Browse files
authored
Merge pull request #818 from ThePortlandGroup/nv_stage
Pull 2019-10-24T15-13 Recent NVIDIA Changes
2 parents 63615ea + 911c2fb commit 249b986

File tree

19 files changed

+170
-47
lines changed

19 files changed

+170
-47
lines changed

include/flang/Error/errmsg-in.n

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,13 +1510,16 @@ A DO CONCURRENT or FORALL construct or statement may not specify an index name m
15101510
.MS S 1061 "The definition of function return type of $ does not match its declaration type"
15111511
.MS S 1062 "LOCAL_INIT variable does not have an outside variable of the same name - $"
15121512
A DO CONCURRENT variable with LOCAL_INIT locality must have a host variable of the same name.
1513-
.MS S 1200 "OpenMP GPU - [$] is used, it is not implemented yet."
1513+
Starting from 1100, Reserved for OpenMP GPU
1514+
.MS S 1198 "OpenMP GPU - The feature is not implemented yet for the target device"
1515+
.MS W 1199 "OpenMP GPU - \"$\" is ignored for the target device"
1516+
.MS S 1200 "OpenMP GPU - \"$\" is used, it is not implemented yet"
15141517
.MS S 1201 "OpenMP GPU - [$] is used with [$], this usage is not implemented yet."
15151518
.MS S 1202 "OpenMP GPU - [$] is used independently than [$], this usage is not implemented yet."
15161519
.MS S 1203 "OpenMP GPU - Directive target exit data is used, map type [$] cannot be used. It should be one of 'from', 'release', or 'delete'"
15171520
.MS S 1204 "OpenMP GPU - Directive target data is used, map type [$] cannot be used. It should be one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'"
15181521
.MS S 1205 "OpenMP GPU - Directive target enter data is used, map type [$] cannot be used. It should be one of 'to', or 'alloc'"
1519-
.MS W 1206 "OpenMP GPU - Using [map] clause is used with an array section for $ array is not supported, mapping will be done on entire array."
1522+
.MS W 1206 "OpenMP GPU - Array sections in \"map\" clause is not implemented yet, the entire array will be mapped"
15201523
.MS S 1207 "ERROR STOP stop-code requires either a character or integer expression."
15211524
.MS S 1208 "QUIET requires a logical expression."
15221525
.MS S 1209 "ERROR STOP stop-code integer expression must be an integer of default kind."

include/flang/Error/errmsg.n

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,10 @@ In integer shift, ISHFT(I, SHIFT), absolute value of SHIFT cannot be bigger than
714714
The accelerator feature in the PGI compilers is separately licensed;
715715
that license was not found.
716716
Please update your licenses to use this feature.
717-
.MS S 1200 "OpenMP GPU - [$] is used, it is not implemented yet."
717+
Starting from 1100, Reserved for OpenMP GPU
718+
.MS S 1198 "OpenMP GPU - The feature is not implemented yet for the target device"
719+
.MS W 1199 "OpenMP GPU - \"$\" is ignored for the target device"
720+
.MS S 1200 "OpenMP GPU - \"$\" is used, it is not implemented yet"
718721
.MS S 1201 "OpenMP GPU - [$] is used with [$], this usage is not implemented yet."
719722
.MS S 1202 "OpenMP GPU - [$] is used independently than [$], this usage is not implemented yet."
720723
.MS S 1204 "OpenMP GPU - Internal compiler error. Reason: [$] at [$]"

runtime/flang/ipopcnt.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ __mth_i_ipopcnt(uint32_t u32)
2626
asm("popcnt %1, %0"
2727
: "=r"(r32)
2828
: "r"(u32)
29-
:
3029
);
3130
#elif defined(TARGET_LINUX_POWER)
3231
asm("popcntw %0, %1"
3332
: "=r"(r32)
3433
: "r"(u32)
35-
:
3634
);
3735
#else
3836
static const uint32_t u5s = 0x55555555;

runtime/flang/ipopcnti.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,11 @@ __mth_i_ipopcnti(uint32_t u32, int size)
3838
asm("popcnt %1, %0"
3939
: "=r"(r32)
4040
: "r"(r32)
41-
:
4241
);
4342
#elif defined(TARGET_LINUX_POWER)
4443
asm("popcntw %0, %1"
4544
: "=r"(r32)
4645
: "r"(r32)
47-
:
4846
);
4947
#else
5048

runtime/flang/ipoppar.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ __mth_i_ipoppar(uint32_t u32)
2727
"\tandl $0x1, %0"
2828
: "=r"(r32)
2929
: "r"(u32)
30-
:
3130
);
3231
#elif defined(TARGET_LINUX_POWER)
3332
asm("popcntw %0, %1\n"
3433
"\trldicl %0, %0, 0, 63"
3534
: "=r"(r32)
3635
: "r"(u32)
37-
:
3836
);
3937
#else
4038
r32 = u32;

runtime/flang/ipoppari.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,12 @@ __mth_i_ipoppari(uint32_t u32, int32_t size)
3434
"\tandl $0x1, %0"
3535
: "=r"(r32)
3636
: "r"(r32)
37-
:
3837
);
3938
#elif defined(TARGET_LINUX_POWER)
4039
asm("popcntw %0, %1\n"
4140
"\trldicl %0, %0, 0, 63"
4241
: "=r"(r32)
4342
: "r"(r32)
44-
:
4543
);
4644
#else
4745
r32 ^= r32 >> 16;

runtime/flang/kpopcnt.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ __mth_i_kpopcnt(uint64_t u64)
2626
asm("popcnt %1, %0"
2727
: "=r"(r64)
2828
: "r"(u64)
29-
:
3029
);
3130
#elif defined(TARGET_LINUX_POWER)
3231
asm("popcntd %0, %1"
3332
: "=r"(r64)
3433
: "r"(u64)
35-
:
3634
);
3735
#else
3836
static const uint64_t u5s = 0x5555555555555555ul;

runtime/flang/kpoppar.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ __mth_i_kpoppar(uint64_t u64)
2727
"\tandq $0x1, %0"
2828
: "=r"(r64)
2929
: "r"(u64)
30-
:
3130
);
3231
#elif defined(TARGET_LINUX_POWER)
3332
asm("popcntd %0, %1\n"
3433
"\trldicl %0, %0, 0, 63"
3534
: "=r"(r64)
3635
: "r"(u64)
37-
:
3836
);
3937
#else
4038
r64 = u64;

test/f90_correct/inc/fs11.mk

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2015-2018, NVIDIA CORPORATION. All rights reserved.
2+
# Copyright (c) 2015-2019, 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.
@@ -18,8 +18,13 @@
1818

1919
# Determine call instruction used
2020
INSN=call
21+
LLFLAG=
22+
OPT=
2123
ifeq ($(findstring aarch64, $(UNAME)), aarch64)
2224
INSN=bl
25+
ifeq ($(findstring O0, $(OPT)), O0)
26+
LLFLAG=-Mkeepll
27+
endif
2328
endif
2429
ifeq ($(findstring ppc64le, $(UNAME)), ppc64le)
2530
INSN=bl
@@ -31,7 +36,7 @@ build: $(SRC)/fs11.f90
3136
-$(RM) fs11.$(EXESUFFIX) core *.d *.mod FOR*.DAT FTN* ftn* fort.*
3237
@echo ------------------------------------ building test $@
3338
-$(CC) -c $(CFLAGS) $(SRC)/check.c -o check.$(OBJX)
34-
-$(FC) $(FFLAGS) $(LDFLAGS) $(SRC)/fs11.f90 -S
39+
-$(FC) $(FFLAGS) $(LLFLAG) $(LDFLAGS) $(SRC)/fs11.f90 -S
3540
-$(FC) -c $(FFLAGS) $(LDFLAGS) $(SRC)/fs11.f90 -o fs11.$(OBJX)
3641
-$(FC) $(FFLAGS) $(LDFLAGS) fs11.$(OBJX) check.$(OBJX) $(LIBS) -o fs11.$(EXESUFFIX)
3742

@@ -40,12 +45,24 @@ build: $(SRC)/fs11.f90
4045
# This check isn't valid for flang because it allows LLVM to inline.
4146
run:
4247
@echo ------------------------------------ executing test fs11
48+
ifeq ($(LLFLAG), -Mkeepll)
49+
@mmul_calls=`grep -c 'void (.*)\*.*mmul' fs11.ll`; \
50+
if [ $$mmul_calls -ne 3 ]; then \
51+
echo "RESULT: FAIL - expected exactly 3 calls to mmul, got $$mmul_calls in fs11.ll" ; \
52+
exit 1; \
53+
else \
54+
echo "RESULT: PASS - got exactly 3 calls to mmul in fs11.ll" ; \
55+
fi
56+
else
4357
ifneq ($(FC), flang)
4458
@mmul_calls=`grep -c '$(INSN).*mmul' fs11.s`; \
4559
if [ $$mmul_calls -ne 3 ]; then \
46-
echo "RESULT: FAIL - expected exactly 3 calls to mmul, got $$mmul_calls" ; \
60+
echo "RESULT: FAIL - expected exactly 3 calls to mmul, got $$mmul_calls in fs11.s" ; \
4761
exit 1; \
62+
else \
63+
echo "RESULT: PASS - got exactly 3 calls to mmul in fs11.s" ; \
4864
fi
65+
endif
4966
endif
5067
fs11.$(EXESUFFIX)
5168

tools/flang1/flang1exe/semsmp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,6 +1921,11 @@ semsmp(int rednum, SST *top)
19211921
clause_errchk((BT_TARGET | BT_SIMD), "OMP TARGET SIMD");
19221922
mp_create_bscope(0);
19231923
DI_BTARGET(sem.doif_depth) = emit_btarget(A_MP_TARGET);
1924+
#if defined(OMP_OFFLOAD_LLVM) || defined(OMP_OFFLOAD_PGI)
1925+
if(flg.omptarget)
1926+
A_COMBINEDTYPEP(DI_BTARGET(sem.doif_depth),
1927+
get_omp_combined_mode(BT_TARGET | BT_SIMD));
1928+
#endif
19241929
par_push_scope(TRUE);
19251930
begin_parallel_clause(sem.doif_depth);
19261931
SST_ASTP(LHS, 0);
@@ -10220,6 +10225,9 @@ get_omp_combined_mode(BIGINT64 type)
1022010225
combined_type = BT_TARGET | BT_PARDO | BT_SIMD;
1022110226
if ((type & combined_type) == combined_type)
1022210227
return mode_target_parallel_for_simd;
10228+
combined_type = BT_TARGET | BT_SIMD;
10229+
if ((type & combined_type) == combined_type)
10230+
return mode_target_simd;
1022310231
if ((type & BT_TARGET))
1022410232
return mode_target;
1022510233
return mode_none_target;

0 commit comments

Comments
 (0)