Skip to content

Commit db9f884

Browse files
committed
Recognize OpenMP target simd construct
This patch treats "target simd" as a "target" construct. Data attributes are honored by the front end. There is no parallelism applied yet.
1 parent 9878819 commit db9f884

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

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;

tools/shared/llmputil.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ bool is_omp_mode_target(OMP_TARGET_MODE mode) {
466466
case mode_target_parallel:
467467
case mode_target_parallel_for:
468468
case mode_target_parallel_for_simd:
469+
case mode_target_simd:
469470
return true;
470471
default:
471472
return false;

tools/shared/llmputil.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ typedef enum {
100100
mode_target_parallel,
101101
mode_target_parallel_for,
102102
mode_target_parallel_for_simd,
103+
mode_target_simd,
103104
mode_target_data_enter_region,
104105
mode_target_data_exit_region,
105106
mode_target_data_region,
@@ -123,6 +124,7 @@ static const char *omp_target_mode_names[] = {
123124
"target parallel",
124125
"target parallel for",
125126
"target parallel for simd",
127+
"target simd",
126128
"target data enter",
127129
"target data exit",
128130
"target data",

0 commit comments

Comments
 (0)