From 30e37aff541b11fba782f58bcf8ec364ad568184 Mon Sep 17 00:00:00 2001 From: Anjia Wang Date: Mon, 24 Nov 2025 01:30:02 +0000 Subject: [PATCH 1/6] Preserve clause occurrences and separators --- src/OpenACCIR.cpp | 23 +++---- src/OpenACCIR.h | 33 ++++++---- src/OpenACCIRToString.cpp | 21 +++--- src/OpenACCKinds.h | 6 ++ tests/builtin/reference/ref_data.txt | 18 ++--- tests/builtin/reference/ref_data_fortran.txt | 18 ++--- tests/builtin/reference/ref_declare.txt | 6 +- .../builtin/reference/ref_declare_fortran.txt | 6 +- tests/builtin/reference/ref_enter_data.txt | 12 ++-- .../reference/ref_enter_data_fortran.txt | 12 ++-- tests/builtin/reference/ref_exit_data.txt | 10 +-- .../reference/ref_exit_data_fortran.txt | 10 +-- tests/builtin/reference/ref_host_data.txt | 2 +- .../reference/ref_host_data_fortran.txt | 2 +- tests/builtin/reference/ref_kernels.txt | 34 +++++----- .../builtin/reference/ref_kernels_fortran.txt | 34 +++++----- tests/builtin/reference/ref_kernels_loop.txt | 66 +++++++++---------- .../reference/ref_kernels_loop_fortran.txt | 66 +++++++++---------- tests/builtin/reference/ref_loop.txt | 32 ++++----- tests/builtin/reference/ref_loop_fortran.txt | 32 ++++----- tests/builtin/reference/ref_parallel.txt | 42 ++++++------ .../reference/ref_parallel_fortran.txt | 42 ++++++------ tests/builtin/reference/ref_parallel_loop.txt | 66 +++++++++---------- .../reference/ref_parallel_loop_fortran.txt | 66 +++++++++---------- tests/builtin/reference/ref_routine.txt | 2 +- .../builtin/reference/ref_routine_fortran.txt | 2 +- tests/builtin/reference/ref_serial.txt | 34 +++++----- .../builtin/reference/ref_serial_fortran.txt | 34 +++++----- tests/builtin/reference/ref_serial_loop.txt | 58 ++++++++-------- .../reference/ref_serial_loop_fortran.txt | 58 ++++++++-------- tests/builtin/reference/ref_set.txt | 4 +- tests/builtin/reference/ref_set_fortran.txt | 4 +- tests/builtin/reference/ref_update.txt | 22 +++---- .../builtin/reference/ref_update_fortran.txt | 22 +++---- 34 files changed, 456 insertions(+), 443 deletions(-) diff --git a/src/OpenACCIR.cpp b/src/OpenACCIR.cpp index 3d9c1f2..c854b7a 100644 --- a/src/OpenACCIR.cpp +++ b/src/OpenACCIR.cpp @@ -2,22 +2,15 @@ #include #include -// Initialize static flag - default to true for backward compatibility -bool OpenACCDirective::enable_clause_merging = true; - -void OpenACCClause::addLangExpr(std::string expression, int line, int col) { - // Since the size of expression vector is supposed to be small, brute force - // is used here. - // NOTE: Deduplication disabled for tile, num_gangs, gang where position matters - bool allow_duplicates = (kind == ACCC_tile || kind == ACCC_num_gangs || kind == ACCC_gang); - if (!allow_duplicates) { - for (unsigned int i = 0; i < this->expressions.size(); i++) { - if (expressions.at(i) == expression) { - return; - }; - }; - } +// Initialize static flag - disable merging by default to preserve clause +// occurrences and ordering. +bool OpenACCDirective::enable_clause_merging = false; + +void OpenACCClause::addLangExpr(std::string expression, + OpenACCClauseSeparator sep, int line, + int col) { expressions.push_back(expression); + expression_separators.push_back(sep); locations.push_back(ACC_SourceLocation(line, col)); }; diff --git a/src/OpenACCIR.h b/src/OpenACCIR.h index 0bcd125..8d281d5 100644 --- a/src/OpenACCIR.h +++ b/src/OpenACCIR.h @@ -8,6 +8,11 @@ #include "OpenACCKinds.h" +struct OpenACCExpressionItem { + std::string text; + OpenACCClauseSeparator separator = ACCC_CLAUSE_SEP_comma; +}; + enum OpenACCBaseLang { ACC_Lang_C, ACC_Lang_Cplusplus, @@ -56,6 +61,7 @@ class OpenACCClause : public ACC_SourceLocation { * record for an expression and its location */ std::vector expressions; + std::vector expression_separators; std::vector locations; @@ -75,9 +81,14 @@ class OpenACCClause : public ACC_SourceLocation { // a list of expressions or variables that are language-specific for the // clause, accparser does not parse them, instead, it only stores them as // strings - void addLangExpr(std::string expression_string, int line = 0, int col = 0); + void addLangExpr(std::string expression_string, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma, + int line = 0, int col = 0); std::vector *getExpressions() { return &expressions; }; + const std::vector &getExpressionSeparators() const { + return expression_separators; + } virtual std::string toString(); virtual ~OpenACCClause() = default; @@ -87,27 +98,27 @@ class OpenACCClause : public ACC_SourceLocation { // Common base for clauses that carry a variable list. class OpenACCVarListClause : public OpenACCClause { protected: - std::vector vars; + std::vector vars; public: OpenACCVarListClause(OpenACCClauseKind k, int _line = 0, int _col = 0) : OpenACCClause(k, _line, _col) {} - void addVar(const std::string &expr) { - if (std::find(vars.begin(), vars.end(), expr) == vars.end()) { - vars.push_back(expr); - } + void addVar(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + vars.push_back(OpenACCExpressionItem{expr, sep}); } + void addVar(const OpenACCExpressionItem &item) { vars.push_back(item); } - const std::vector &getVars() const { return vars; } + const std::vector &getVars() const { return vars; } std::string varsToString() const { std::string out; - for (auto it = vars.begin(); it != vars.end(); ++it) { - out += *it; - if (it + 1 != vars.end()) { - out += ", "; + for (size_t idx = 0; idx < vars.size(); ++idx) { + if (idx > 0) { + out += (vars[idx].separator == ACCC_CLAUSE_SEP_comma) ? ", " : " "; } + out += vars[idx].text; } return out; } diff --git a/src/OpenACCIRToString.cpp b/src/OpenACCIRToString.cpp index 9a42fb1..e62b8a2 100644 --- a/src/OpenACCIRToString.cpp +++ b/src/OpenACCIRToString.cpp @@ -128,11 +128,14 @@ std::string OpenACCClause::expressionToString() { std::string result; std::vector *expr = this->getExpressions(); if (expr != NULL && !expr->empty()) { - for (auto it = expr->begin(); it != expr->end(); ++it) { - if (it != expr->begin()) { - result += ", "; + const auto &seps = this->getExpressionSeparators(); + for (size_t idx = 0; idx < expr->size(); ++idx) { + if (idx > 0) { + OpenACCClauseSeparator sep = + (idx < seps.size()) ? seps[idx] : ACCC_CLAUSE_SEP_comma; + result += (sep == ACCC_CLAUSE_SEP_comma) ? ", " : " "; } - result += *it; + result += (*expr)[idx]; } } @@ -628,15 +631,15 @@ std::string OpenACCCreateClause::toString() { static std::string varClauseToString(const std::string &keyword, - const std::vector &vars) { + const std::vector &vars) { std::string result = keyword; if (!vars.empty()) { result += "("; - for (auto it = vars.begin(); it != vars.end(); ++it) { - result += *it; - if (it + 1 != vars.end()) { - result += ", "; + for (size_t idx = 0; idx < vars.size(); ++idx) { + if (idx > 0) { + result += (vars[idx].separator == ACCC_CLAUSE_SEP_comma) ? ", " : " "; } + result += vars[idx].text; } result += ") "; } else { diff --git a/src/OpenACCKinds.h b/src/OpenACCKinds.h index b781a35..67f818e 100644 --- a/src/OpenACCKinds.h +++ b/src/OpenACCKinds.h @@ -89,6 +89,12 @@ enum OpenACCClauseKind { #undef OPENACC_CLAUSE }; +// Separator used between clause arguments when unparsing. +enum OpenACCClauseSeparator { + ACCC_CLAUSE_SEP_space, + ACCC_CLAUSE_SEP_comma +}; + enum OpenACCDeviceTypeKind { ACCC_DEVICE_TYPE_unknown, ACCC_DEVICE_TYPE_host, diff --git a/tests/builtin/reference/ref_data.txt b/tests/builtin/reference/ref_data.txt index 8878559..fcbeacc 100644 --- a/tests/builtin/reference/ref_data.txt +++ b/tests/builtin/reference/ref_data.txt @@ -18,19 +18,19 @@ #pragma acc data if(x==3) #pragma acc data no_create(a, b, c) #pragma acc data present(a, b, c) -#pragma acc data copyin(readonly: x, y, z, a, b, c) -#pragma acc data copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +#pragma acc data copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +#pragma acc data copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) #pragma acc data copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc data copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc data copyin(x, y, z, a, b, c) -#pragma acc data copyout(zero: x, y, z, a, b, c) -#pragma acc data copyout(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc data copyin(x, y, z) copyin(a, b, c) +#pragma acc data copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +#pragma acc data copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) #pragma acc data copyout(x, y, z) copyout(zero: a, b, c) #pragma acc data copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc data copyout(x, y, z, a, b, c) -#pragma acc data create(zero: x, y, z, a, b, c) -#pragma acc data create(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc data copyout(x, y, z) copyout(a, b, c) +#pragma acc data create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +#pragma acc data create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) #pragma acc data create(x, y, z) create(zero: a, b, c) #pragma acc data create(zero: x, y, z) create(a, b, c) -#pragma acc data create(x, y, z, a, b, c) +#pragma acc data create(x, y, z) create(a, b, c) #pragma acc data copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) diff --git a/tests/builtin/reference/ref_data_fortran.txt b/tests/builtin/reference/ref_data_fortran.txt index 7d85701..a706770 100644 --- a/tests/builtin/reference/ref_data_fortran.txt +++ b/tests/builtin/reference/ref_data_fortran.txt @@ -18,20 +18,20 @@ !$acc data if(x==3) !$acc data no_create(a, b, c) !$acc data present(a, b, c) -!$acc data copyin(readonly: x, y, z, a, b, c) -!$acc data copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +!$acc data copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +!$acc data copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) !$acc data copyin(x, y, z) copyin(readonly: a, b, c) !$acc data copyin(readonly: x, y, z) copyin(a, b, c) -!$acc data copyin(x, y, z, a, b, c) -!$acc data copyout(zero: x, y, z, a, b, c) -!$acc data copyout(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc data copyin(x, y, z) copyin(a, b, c) +!$acc data copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +!$acc data copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) !$acc data copyout(x, y, z) copyout(zero: a, b, c) !$acc data copyout(zero: x, y, z) copyout(a, b, c) -!$acc data copyout(x, y, z, a, b, c) -!$acc data create(zero: x, y, z, a, b, c) -!$acc data create(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc data copyout(x, y, z) copyout(a, b, c) +!$acc data create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +!$acc data create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) !$acc data create(x, y, z) create(zero: a, b, c) !$acc data create(zero: x, y, z) create(a, b, c) -!$acc data create(x, y, z, a, b, c) +!$acc data create(x, y, z) create(a, b, c) !$acc data copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) !$acc end data diff --git a/tests/builtin/reference/ref_declare.txt b/tests/builtin/reference/ref_declare.txt index f66e2b8..90e16d2 100644 --- a/tests/builtin/reference/ref_declare.txt +++ b/tests/builtin/reference/ref_declare.txt @@ -3,11 +3,11 @@ #pragma acc declare copyin(readonly: m, n) #pragma acc declare copyin(readonly: m, n, readonly) #pragma acc declare copyin(readonly: readonly::m, n, readonly) -#pragma acc declare copyin(readonly: x, y, z, a, b, c) -#pragma acc declare copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +#pragma acc declare copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +#pragma acc declare copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) #pragma acc declare copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc declare copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc declare copyin(x, y, z, a, b, c) +#pragma acc declare copyin(x, y, z) copyin(a, b, c) #pragma acc declare copyout(12, 23, 34) #pragma acc declare create(12, 23, 34) #pragma acc declare present(a, b, c) diff --git a/tests/builtin/reference/ref_declare_fortran.txt b/tests/builtin/reference/ref_declare_fortran.txt index 97b9724..e772146 100644 --- a/tests/builtin/reference/ref_declare_fortran.txt +++ b/tests/builtin/reference/ref_declare_fortran.txt @@ -3,11 +3,11 @@ !$acc declare copyin(readonly: m, n) !$acc declare copyin(readonly: m, n, readonly) !$acc declare copyin(readonly: readonly::m, n, readonly) -!$acc declare copyin(readonly: x, y, z, a, b, c) -!$acc declare copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +!$acc declare copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +!$acc declare copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) !$acc declare copyin(x, y, z) copyin(readonly: a, b, c) !$acc declare copyin(readonly: x, y, z) copyin(a, b, c) -!$acc declare copyin(x, y, z, a, b, c) +!$acc declare copyin(x, y, z) copyin(a, b, c) !$acc declare copyout(12, 23, 34) !$acc declare create(12, 23, 34) !$acc declare present(a, b, c) diff --git a/tests/builtin/reference/ref_enter_data.txt b/tests/builtin/reference/ref_enter_data.txt index 8882619..720f142 100644 --- a/tests/builtin/reference/ref_enter_data.txt +++ b/tests/builtin/reference/ref_enter_data.txt @@ -1,22 +1,22 @@ #pragma acc enter data async(5) #pragma acc enter data attach(a, b, c) #pragma acc enter data copyin(x, y) -#pragma acc enter data copyin(x, y, z, a, b, c) +#pragma acc enter data copyin(x, y, z) copyin(a, b, c) #pragma acc enter data create(12, 23, 34) #pragma acc enter data create(zero: 12, 23, 34) #pragma acc enter data create(zero: 12, 23, 34, zero) #pragma acc enter data create(zero: zero::12, 23, 34) #pragma acc enter data if(5) #pragma acc enter data if(x==3) -#pragma acc enter data create(zero: x, y, z, a, b, c) -#pragma acc enter data create(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc enter data create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +#pragma acc enter data create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) #pragma acc enter data create(x, y, z) create(zero: a, b, c) #pragma acc enter data create(zero: x, y, z) create(a, b, c) -#pragma acc enter data create(x, y, z, a, b, c) +#pragma acc enter data create(x, y, z) create(a, b, c) #pragma acc enter data async(expression1) async(expression2) async(expression3) -#pragma acc enter data async(expression1) async(expression2) +#pragma acc enter data async(expression1) async(expression2) async(expression1) #pragma acc enter data async(expression1) async -#pragma acc enter data async async(expression1) +#pragma acc enter data async async(expression1) async #pragma acc enter data wait(queues::a, devnum::b, devnum::queues::c) #pragma acc enter data wait(queues: 12, 23, 34) #pragma acc enter data wait(devnum: 12: queues: 23, 34) diff --git a/tests/builtin/reference/ref_enter_data_fortran.txt b/tests/builtin/reference/ref_enter_data_fortran.txt index 5006733..9af5d9b 100644 --- a/tests/builtin/reference/ref_enter_data_fortran.txt +++ b/tests/builtin/reference/ref_enter_data_fortran.txt @@ -1,22 +1,22 @@ !$acc enter data async(5) !$acc enter data attach(a, b, c) !$acc enter data copyin(x, y) -!$acc enter data copyin(x, y, z, a, b, c) +!$acc enter data copyin(x, y, z) copyin(a, b, c) !$acc enter data create(12, 23, 34) !$acc enter data create(zero: 12, 23, 34) !$acc enter data create(zero: 12, 23, 34, zero) !$acc enter data create(zero: zero::12, 23, 34) !$acc enter data if(5) !$acc enter data if(x==3) -!$acc enter data create(zero: x, y, z, a, b, c) -!$acc enter data create(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc enter data create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +!$acc enter data create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) !$acc enter data create(x, y, z) create(zero: a, b, c) !$acc enter data create(zero: x, y, z) create(a, b, c) -!$acc enter data create(x, y, z, a, b, c) +!$acc enter data create(x, y, z) create(a, b, c) !$acc enter data async(expression1) async(expression2) async(expression3) -!$acc enter data async(expression1) async(expression2) +!$acc enter data async(expression1) async(expression2) async(expression1) !$acc enter data async(expression1) async -!$acc enter data async async(expression1) +!$acc enter data async async(expression1) async !$acc enter data wait(queues::a, devnum::b, devnum::queues::c) !$acc enter data wait(queues: 12, 23, 34) !$acc enter data wait(devnum: 12: queues: 23, 34) diff --git a/tests/builtin/reference/ref_exit_data.txt b/tests/builtin/reference/ref_exit_data.txt index 695cb40..e64fcee 100644 --- a/tests/builtin/reference/ref_exit_data.txt +++ b/tests/builtin/reference/ref_exit_data.txt @@ -1,17 +1,17 @@ #pragma acc exit data async(5) #pragma acc exit data copyout(x, y) -#pragma acc exit data copyout(x, y, z, a, b, c) +#pragma acc exit data copyout(x, y, z) copyout(a, b, c) #pragma acc exit data wait(12, 23, 34) #pragma acc exit data if(5) #pragma acc exit data if(x==3) #pragma acc exit data async(expression1) async(expression2) async(expression3) -#pragma acc exit data async(expression1) async(expression2) +#pragma acc exit data async(expression1) async(expression2) async(expression1) #pragma acc exit data async(expression1) async -#pragma acc exit data async async(expression1) +#pragma acc exit data async async(expression1) async #pragma acc exit data delete(x, y) -#pragma acc exit data delete(x, y, z, a, b, c) +#pragma acc exit data delete(x, y, z) delete(a, b, c) #pragma acc exit data detach(x, y) -#pragma acc exit data detach(x, y, z, a, b, c) +#pragma acc exit data detach(x, y, z) detach(a, b, c) #pragma acc exit data finalize #pragma acc exit data wait(queues::a, devnum::b, devnum::queues::c) #pragma acc exit data wait(queues: 12, 23, 34) diff --git a/tests/builtin/reference/ref_exit_data_fortran.txt b/tests/builtin/reference/ref_exit_data_fortran.txt index e2b920f..9f52f28 100644 --- a/tests/builtin/reference/ref_exit_data_fortran.txt +++ b/tests/builtin/reference/ref_exit_data_fortran.txt @@ -1,17 +1,17 @@ !$acc exit data async(5) !$acc exit data copyout(x, y) -!$acc exit data copyout(x, y, z, a, b, c) +!$acc exit data copyout(x, y, z) copyout(a, b, c) !$acc exit data wait(12, 23, 34) !$acc exit data if(5) !$acc exit data if(x==3) !$acc exit data async(expression1) async(expression2) async(expression3) -!$acc exit data async(expression1) async(expression2) +!$acc exit data async(expression1) async(expression2) async(expression1) !$acc exit data async(expression1) async -!$acc exit data async async(expression1) +!$acc exit data async async(expression1) async !$acc exit data delete(x, y) -!$acc exit data delete(x, y, z, a, b, c) +!$acc exit data delete(x, y, z) delete(a, b, c) !$acc exit data detach(x, y) -!$acc exit data detach(x, y, z, a, b, c) +!$acc exit data detach(x, y, z) detach(a, b, c) !$acc exit data finalize !$acc exit data wait(queues::a, devnum::b, devnum::queues::c) !$acc exit data wait(queues: 12, 23, 34) diff --git a/tests/builtin/reference/ref_host_data.txt b/tests/builtin/reference/ref_host_data.txt index 1f41006..3e02d1d 100644 --- a/tests/builtin/reference/ref_host_data.txt +++ b/tests/builtin/reference/ref_host_data.txt @@ -3,4 +3,4 @@ #pragma acc host_data if(5) if_present #pragma acc host_data use_device(a, b, c) #pragma acc host_data use_device(a, b, c) if(5) if_present -#pragma acc host_data use_device(a, b, c, d) if(5) if_present +#pragma acc host_data use_device(a, b, c) use_device(a, b, c, d) if(5) if_present if_present diff --git a/tests/builtin/reference/ref_host_data_fortran.txt b/tests/builtin/reference/ref_host_data_fortran.txt index 6cbf003..b0b826d 100644 --- a/tests/builtin/reference/ref_host_data_fortran.txt +++ b/tests/builtin/reference/ref_host_data_fortran.txt @@ -4,5 +4,5 @@ !$acc host_data if(5) if_present !$acc host_data use_device(a, b, c) !$acc host_data use_device(a, b, c) if(5) if_present -!$acc host_data use_device(a, b, c, d) if(5) if_present +!$acc host_data use_device(a, b, c) use_device(a, b, c, d) if(5) if_present if_present !$acc end host_data diff --git a/tests/builtin/reference/ref_kernels.txt b/tests/builtin/reference/ref_kernels.txt index cc50e51..cd1ff18 100644 --- a/tests/builtin/reference/ref_kernels.txt +++ b/tests/builtin/reference/ref_kernels.txt @@ -25,33 +25,33 @@ #pragma acc kernels self(5) #pragma acc kernels self(x==3) #pragma acc kernels device_type(x, y, z) -#pragma acc kernels copyin(readonly: x, y, z, a, b, c) -#pragma acc kernels copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +#pragma acc kernels copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +#pragma acc kernels copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) #pragma acc kernels copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc kernels copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc kernels copyin(x, y, z, a, b, c) -#pragma acc kernels copyout(zero: x, y, z, a, b, c) -#pragma acc kernels copyout(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc kernels copyin(x, y, z) copyin(a, b, c) +#pragma acc kernels copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +#pragma acc kernels copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) #pragma acc kernels copyout(x, y, z) copyout(zero: a, b, c) #pragma acc kernels copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc kernels copyout(x, y, z, a, b, c) -#pragma acc kernels create(zero: x, y, z, a, b, c) -#pragma acc kernels create(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc kernels copyout(x, y, z) copyout(a, b, c) +#pragma acc kernels create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +#pragma acc kernels create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) #pragma acc kernels create(x, y, z) create(zero: a, b, c) #pragma acc kernels create(zero: x, y, z) create(a, b, c) -#pragma acc kernels create(x, y, z, a, b, c) +#pragma acc kernels create(x, y, z) create(a, b, c) #pragma acc kernels async(expression1) async(expression2) async(expression3) -#pragma acc kernels async(expression1) async(expression2) +#pragma acc kernels async(expression1) async(expression2) async(expression1) #pragma acc kernels async(expression1) async -#pragma acc kernels async async(expression1) +#pragma acc kernels async async(expression1) async #pragma acc kernels num_workers(expression1) num_workers(expression2) num_workers(expression3) -#pragma acc kernels num_workers(expression1) num_workers(expression2) +#pragma acc kernels num_workers(expression1) num_workers(expression2) num_workers(expression1) #pragma acc kernels vector_length(expression1) vector_length(expression2) vector_length(expression3) -#pragma acc kernels vector_length(expression1) vector_length(expression2) +#pragma acc kernels vector_length(expression1) vector_length(expression2) vector_length(expression1) #pragma acc kernels self(expression1) self(expression2) self(expression3) -#pragma acc kernels self(expression1) self(expression2) +#pragma acc kernels self(expression1) self(expression2) self(expression1) #pragma acc kernels self(expression1) self -#pragma acc kernels self self(expression1) +#pragma acc kernels self self(expression1) self #pragma acc kernels num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -#pragma acc kernels num_gangs(expression1) num_gangs(expression2) -#pragma acc kernels wait wait(a, b, c, d) +#pragma acc kernels num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) +#pragma acc kernels wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) diff --git a/tests/builtin/reference/ref_kernels_fortran.txt b/tests/builtin/reference/ref_kernels_fortran.txt index 1d762e0..6cb538f 100644 --- a/tests/builtin/reference/ref_kernels_fortran.txt +++ b/tests/builtin/reference/ref_kernels_fortran.txt @@ -25,34 +25,34 @@ !$acc kernels self(5) !$acc kernels self(x==3) !$acc kernels device_type(x, y, z) -!$acc kernels copyin(readonly: x, y, z, a, b, c) -!$acc kernels copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +!$acc kernels copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +!$acc kernels copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) !$acc kernels copyin(x, y, z) copyin(readonly: a, b, c) !$acc kernels copyin(readonly: x, y, z) copyin(a, b, c) -!$acc kernels copyin(x, y, z, a, b, c) -!$acc kernels copyout(zero: x, y, z, a, b, c) -!$acc kernels copyout(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc kernels copyin(x, y, z) copyin(a, b, c) +!$acc kernels copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +!$acc kernels copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) !$acc kernels copyout(x, y, z) copyout(zero: a, b, c) !$acc kernels copyout(zero: x, y, z) copyout(a, b, c) -!$acc kernels copyout(x, y, z, a, b, c) -!$acc kernels create(zero: x, y, z, a, b, c) -!$acc kernels create(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc kernels copyout(x, y, z) copyout(a, b, c) +!$acc kernels create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +!$acc kernels create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) !$acc kernels create(x, y, z) create(zero: a, b, c) !$acc kernels create(zero: x, y, z) create(a, b, c) -!$acc kernels create(x, y, z, a, b, c) +!$acc kernels create(x, y, z) create(a, b, c) !$acc kernels async(expression1) async(expression2) async(expression3) -!$acc kernels async(expression1) async(expression2) +!$acc kernels async(expression1) async(expression2) async(expression1) !$acc kernels async(expression1) async -!$acc kernels async async(expression1) +!$acc kernels async async(expression1) async !$acc kernels num_workers(expression1) num_workers(expression2) num_workers(expression3) -!$acc kernels num_workers(expression1) num_workers(expression2) +!$acc kernels num_workers(expression1) num_workers(expression2) num_workers(expression1) !$acc kernels vector_length(expression1) vector_length(expression2) vector_length(expression3) -!$acc kernels vector_length(expression1) vector_length(expression2) +!$acc kernels vector_length(expression1) vector_length(expression2) vector_length(expression1) !$acc kernels self(expression1) self(expression2) self(expression3) -!$acc kernels self(expression1) self(expression2) +!$acc kernels self(expression1) self(expression2) self(expression1) !$acc kernels self(expression1) self -!$acc kernels self self(expression1) +!$acc kernels self self(expression1) self !$acc kernels num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -!$acc kernels num_gangs(expression1) num_gangs(expression2) -!$acc kernels wait wait(a, b, c, d) +!$acc kernels num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) +!$acc kernels wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) !$acc end kernels diff --git a/tests/builtin/reference/ref_kernels_loop.txt b/tests/builtin/reference/ref_kernels_loop.txt index 41a254b..65e182b 100644 --- a/tests/builtin/reference/ref_kernels_loop.txt +++ b/tests/builtin/reference/ref_kernels_loop.txt @@ -25,76 +25,76 @@ #pragma acc kernels loop self(5) #pragma acc kernels loop self(x==3) #pragma acc kernels loop device_type(x, y, z) -#pragma acc kernels loop copyin(readonly: x, y, z, a, b, c) -#pragma acc kernels loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +#pragma acc kernels loop copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +#pragma acc kernels loop copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) #pragma acc kernels loop copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc kernels loop copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc kernels loop copyin(x, y, z, a, b, c) -#pragma acc kernels loop copyout(zero: x, y, z, a, b, c) -#pragma acc kernels loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc kernels loop copyin(x, y, z) copyin(a, b, c) +#pragma acc kernels loop copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +#pragma acc kernels loop copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) #pragma acc kernels loop copyout(x, y, z) copyout(zero: a, b, c) #pragma acc kernels loop copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc kernels loop copyout(x, y, z, a, b, c) -#pragma acc kernels loop create(zero: x, y, z, a, b, c) -#pragma acc kernels loop create(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc kernels loop copyout(x, y, z) copyout(a, b, c) +#pragma acc kernels loop create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +#pragma acc kernels loop create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) #pragma acc kernels loop create(x, y, z) create(zero: a, b, c) #pragma acc kernels loop create(zero: x, y, z) create(a, b, c) -#pragma acc kernels loop create(x, y, z, a, b, c) +#pragma acc kernels loop create(x, y, z) create(a, b, c) #pragma acc kernels loop async(expression1) async(expression2) async(expression3) -#pragma acc kernels loop async(expression1) async(expression2) +#pragma acc kernels loop async(expression1) async(expression2) async(expression1) #pragma acc kernels loop async(expression1) async -#pragma acc kernels loop async async(expression1) +#pragma acc kernels loop async async(expression1) async #pragma acc kernels loop num_workers(expression1) num_workers(expression2) num_workers(expression3) -#pragma acc kernels loop num_workers(expression1) num_workers(expression2) +#pragma acc kernels loop num_workers(expression1) num_workers(expression2) num_workers(expression1) #pragma acc kernels loop vector_length(expression1) vector_length(expression2) vector_length(expression3) -#pragma acc kernels loop vector_length(expression1) vector_length(expression2) +#pragma acc kernels loop vector_length(expression1) vector_length(expression2) vector_length(expression1) #pragma acc kernels loop self(expression1) self(expression2) self(expression3) -#pragma acc kernels loop self(expression1) self(expression2) +#pragma acc kernels loop self(expression1) self(expression2) self(expression1) #pragma acc kernels loop self(expression1) self -#pragma acc kernels loop self self(expression1) +#pragma acc kernels loop self self(expression1) self #pragma acc kernels loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -#pragma acc kernels loop num_gangs(expression1) num_gangs(expression2) -#pragma acc kernels loop wait wait(a, b, c, d) +#pragma acc kernels loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) +#pragma acc kernels loop wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) #pragma acc kernels loop #pragma acc kernels loop private(a, b, c) #pragma acc kernels loop auto -#pragma acc kernels loop auto +#pragma acc kernels loop auto auto #pragma acc kernels loop collapse(1) #pragma acc kernels loop collapse(1) collapse(2) -#pragma acc kernels loop collapse(1) collapse(2) +#pragma acc kernels loop collapse(1) collapse(1) collapse(2) #pragma acc kernels loop device_type(a, b, c) #pragma acc kernels loop gang #pragma acc kernels loop gang(a, b, c) -#pragma acc kernels loop gang(a, b, c, d) +#pragma acc kernels loop gang(a, b, c) gang(c) gang(d) #pragma acc kernels loop gang(a, b, c) gang -#pragma acc kernels loop gang gang(a, b, c, d) -#pragma acc kernels loop independent +#pragma acc kernels loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) #pragma acc kernels loop independent +#pragma acc kernels loop independent independent #pragma acc kernels loop seq #pragma acc kernels loop vector(length: a) #pragma acc kernels loop vector(length: a) vector(length: b) -#pragma acc kernels loop vector(length: a) +#pragma acc kernels loop vector(length: a) vector(length: a) #pragma acc kernels loop vector(c) vector(length: c) #pragma acc kernels loop vector(c) vector(b) -#pragma acc kernels loop vector(c) +#pragma acc kernels loop vector(c) vector(c) #pragma acc kernels loop worker(num: a) #pragma acc kernels loop worker(num: a) worker(num: b) -#pragma acc kernels loop worker(num: a) +#pragma acc kernels loop worker(num: a) worker(num: a) #pragma acc kernels loop worker(c) worker(num: c) #pragma acc kernels loop worker(c) worker(b) -#pragma acc kernels loop worker(c) +#pragma acc kernels loop worker(c) worker(c) #pragma acc kernels loop tile(1) -#pragma acc kernels loop tile(1, 2) -#pragma acc kernels loop tile(1, 1, 2) -#pragma acc kernels loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) -#pragma acc kernels loop reduction(+ : x, y, z, a, b, c) +#pragma acc kernels loop tile(1) tile(2) +#pragma acc kernels loop tile(1) tile(1) tile(2) +#pragma acc kernels loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) +#pragma acc kernels loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) #pragma acc kernels loop reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc kernels loop reduction(max : x, y, z) reduction(min : a, b, c) -#pragma acc kernels loop reduction(min : x, y, z, a, b, c) +#pragma acc kernels loop reduction(min : x, y, z) reduction(min : a, b, c) #pragma acc kernels loop reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc kernels loop reduction(|| : x, y, z) reduction(&& : a, b, c) -#pragma acc kernels loop reduction(&& : x, y, z, a, b, c) -#pragma acc kernels loop reduction(max : x, y, max, min) +#pragma acc kernels loop reduction(&& : x, y, z) reduction(&& : a, b, c) +#pragma acc kernels loop reduction(max : x, y, max) reduction(max : x, y, min) #pragma acc kernels loop reduction(+ : x, y, z) #pragma acc kernels loop reduction(* : x, y, z) #pragma acc kernels loop reduction(max : x, y, z) diff --git a/tests/builtin/reference/ref_kernels_loop_fortran.txt b/tests/builtin/reference/ref_kernels_loop_fortran.txt index 39deb57..29f8ba8 100644 --- a/tests/builtin/reference/ref_kernels_loop_fortran.txt +++ b/tests/builtin/reference/ref_kernels_loop_fortran.txt @@ -25,76 +25,76 @@ !$acc kernels loop self(5) !$acc kernels loop self(x==3) !$acc kernels loop device_type(x, y, z) -!$acc kernels loop copyin(readonly: x, y, z, a, b, c) -!$acc kernels loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +!$acc kernels loop copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +!$acc kernels loop copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) !$acc kernels loop copyin(x, y, z) copyin(readonly: a, b, c) !$acc kernels loop copyin(readonly: x, y, z) copyin(a, b, c) -!$acc kernels loop copyin(x, y, z, a, b, c) -!$acc kernels loop copyout(zero: x, y, z, a, b, c) -!$acc kernels loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc kernels loop copyin(x, y, z) copyin(a, b, c) +!$acc kernels loop copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +!$acc kernels loop copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) !$acc kernels loop copyout(x, y, z) copyout(zero: a, b, c) !$acc kernels loop copyout(zero: x, y, z) copyout(a, b, c) -!$acc kernels loop copyout(x, y, z, a, b, c) -!$acc kernels loop create(zero: x, y, z, a, b, c) -!$acc kernels loop create(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc kernels loop copyout(x, y, z) copyout(a, b, c) +!$acc kernels loop create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +!$acc kernels loop create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) !$acc kernels loop create(x, y, z) create(zero: a, b, c) !$acc kernels loop create(zero: x, y, z) create(a, b, c) -!$acc kernels loop create(x, y, z, a, b, c) +!$acc kernels loop create(x, y, z) create(a, b, c) !$acc kernels loop async(expression1) async(expression2) async(expression3) -!$acc kernels loop async(expression1) async(expression2) +!$acc kernels loop async(expression1) async(expression2) async(expression1) !$acc kernels loop async(expression1) async -!$acc kernels loop async async(expression1) +!$acc kernels loop async async(expression1) async !$acc kernels loop num_workers(expression1) num_workers(expression2) num_workers(expression3) -!$acc kernels loop num_workers(expression1) num_workers(expression2) +!$acc kernels loop num_workers(expression1) num_workers(expression2) num_workers(expression1) !$acc kernels loop vector_length(expression1) vector_length(expression2) vector_length(expression3) -!$acc kernels loop vector_length(expression1) vector_length(expression2) +!$acc kernels loop vector_length(expression1) vector_length(expression2) vector_length(expression1) !$acc kernels loop self(expression1) self(expression2) self(expression3) -!$acc kernels loop self(expression1) self(expression2) +!$acc kernels loop self(expression1) self(expression2) self(expression1) !$acc kernels loop self(expression1) self -!$acc kernels loop self self(expression1) +!$acc kernels loop self self(expression1) self !$acc kernels loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -!$acc kernels loop num_gangs(expression1) num_gangs(expression2) -!$acc kernels loop wait wait(a, b, c, d) +!$acc kernels loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) +!$acc kernels loop wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) !$acc kernels loop !$acc kernels loop private(a, b, c) !$acc kernels loop auto -!$acc kernels loop auto +!$acc kernels loop auto auto !$acc kernels loop collapse(1) !$acc kernels loop collapse(1) collapse(2) -!$acc kernels loop collapse(1) collapse(2) +!$acc kernels loop collapse(1) collapse(1) collapse(2) !$acc kernels loop device_type(a, b, c) !$acc kernels loop gang !$acc kernels loop gang(a, b, c) -!$acc kernels loop gang(a, b, c, d) +!$acc kernels loop gang(a, b, c) gang(c) gang(d) !$acc kernels loop gang(a, b, c) gang -!$acc kernels loop gang gang(a, b, c, d) -!$acc kernels loop independent +!$acc kernels loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) !$acc kernels loop independent +!$acc kernels loop independent independent !$acc kernels loop seq !$acc kernels loop vector(length: a) !$acc kernels loop vector(length: a) vector(length: b) -!$acc kernels loop vector(length: a) +!$acc kernels loop vector(length: a) vector(length: a) !$acc kernels loop vector(c) vector(length: c) !$acc kernels loop vector(c) vector(b) -!$acc kernels loop vector(c) +!$acc kernels loop vector(c) vector(c) !$acc kernels loop worker(num: a) !$acc kernels loop worker(num: a) worker(num: b) -!$acc kernels loop worker(num: a) +!$acc kernels loop worker(num: a) worker(num: a) !$acc kernels loop worker(c) worker(num: c) !$acc kernels loop worker(c) worker(b) -!$acc kernels loop worker(c) +!$acc kernels loop worker(c) worker(c) !$acc kernels loop tile(1) -!$acc kernels loop tile(1, 2) -!$acc kernels loop tile(1, 1, 2) -!$acc kernels loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) -!$acc kernels loop reduction(+ : x, y, z, a, b, c) +!$acc kernels loop tile(1) tile(2) +!$acc kernels loop tile(1) tile(1) tile(2) +!$acc kernels loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) +!$acc kernels loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) !$acc kernels loop reduction(+ : x, y, z) reduction(* : a, b, c) !$acc kernels loop reduction(max : x, y, z) reduction(min : a, b, c) -!$acc kernels loop reduction(min : x, y, z, a, b, c) +!$acc kernels loop reduction(min : x, y, z) reduction(min : a, b, c) !$acc kernels loop reduction(min : x, y, z) reduction(&& : a, b, c) !$acc kernels loop reduction(|| : x, y, z) reduction(&& : a, b, c) -!$acc kernels loop reduction(&& : x, y, z, a, b, c) -!$acc kernels loop reduction(max : x, y, max, min) +!$acc kernels loop reduction(&& : x, y, z) reduction(&& : a, b, c) +!$acc kernels loop reduction(max : x, y, max) reduction(max : x, y, min) !$acc kernels loop reduction(+ : x, y, z) !$acc kernels loop reduction(* : x, y, z) !$acc kernels loop reduction(max : x, y, z) diff --git a/tests/builtin/reference/ref_loop.txt b/tests/builtin/reference/ref_loop.txt index a4da729..155171b 100644 --- a/tests/builtin/reference/ref_loop.txt +++ b/tests/builtin/reference/ref_loop.txt @@ -1,43 +1,43 @@ #pragma acc loop #pragma acc loop private(a, b, c) #pragma acc loop auto -#pragma acc loop auto +#pragma acc loop auto auto #pragma acc loop collapse(1) #pragma acc loop collapse(1) collapse(2) -#pragma acc loop collapse(1) collapse(2) +#pragma acc loop collapse(1) collapse(1) collapse(2) #pragma acc loop device_type(a, b, c) #pragma acc loop gang #pragma acc loop gang(a, b, c) -#pragma acc loop gang(a, b, c, d) +#pragma acc loop gang(a, b, c) gang(c) gang(d) #pragma acc loop gang(a, b, c) gang -#pragma acc loop gang gang(a, b, c, d) -#pragma acc loop independent +#pragma acc loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) #pragma acc loop independent +#pragma acc loop independent independent #pragma acc loop seq #pragma acc loop vector(length: a) #pragma acc loop vector(length: a) vector(length: b) -#pragma acc loop vector(length: a) +#pragma acc loop vector(length: a) vector(length: a) #pragma acc loop vector(c) vector(length: c) #pragma acc loop vector(c) vector(b) -#pragma acc loop vector(c) +#pragma acc loop vector(c) vector(c) #pragma acc loop worker(num: a) #pragma acc loop worker(num: a) worker(num: b) -#pragma acc loop worker(num: a) +#pragma acc loop worker(num: a) worker(num: a) #pragma acc loop worker(c) worker(num: c) #pragma acc loop worker(c) worker(b) -#pragma acc loop worker(c) +#pragma acc loop worker(c) worker(c) #pragma acc loop tile(1) -#pragma acc loop tile(1, 2) -#pragma acc loop tile(1, 1, 2) -#pragma acc loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) -#pragma acc loop reduction(+ : x, y, z, a, b, c) +#pragma acc loop tile(1) tile(2) +#pragma acc loop tile(1) tile(1) tile(2) +#pragma acc loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) +#pragma acc loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) #pragma acc loop reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc loop reduction(max : x, y, z) reduction(min : a, b, c) -#pragma acc loop reduction(min : x, y, z, a, b, c) +#pragma acc loop reduction(min : x, y, z) reduction(min : a, b, c) #pragma acc loop reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc loop reduction(|| : x, y, z) reduction(&& : a, b, c) -#pragma acc loop reduction(&& : x, y, z, a, b, c) -#pragma acc loop reduction(max : x, y, max, min) +#pragma acc loop reduction(&& : x, y, z) reduction(&& : a, b, c) +#pragma acc loop reduction(max : x, y, max) reduction(max : x, y, min) #pragma acc loop device_type(x, y, z) #pragma acc loop reduction(+ : x, y, z) #pragma acc loop reduction(* : x, y, z) diff --git a/tests/builtin/reference/ref_loop_fortran.txt b/tests/builtin/reference/ref_loop_fortran.txt index f5f2df7..223639e 100644 --- a/tests/builtin/reference/ref_loop_fortran.txt +++ b/tests/builtin/reference/ref_loop_fortran.txt @@ -1,43 +1,43 @@ !$acc loop !$acc loop private(a, b, c) !$acc loop auto -!$acc loop auto +!$acc loop auto auto !$acc loop collapse(1) !$acc loop collapse(1) collapse(2) -!$acc loop collapse(1) collapse(2) +!$acc loop collapse(1) collapse(1) collapse(2) !$acc loop device_type(a, b, c) !$acc loop gang !$acc loop gang(a, b, c) -!$acc loop gang(a, b, c, d) +!$acc loop gang(a, b, c) gang(c) gang(d) !$acc loop gang(a, b, c) gang -!$acc loop gang gang(a, b, c, d) -!$acc loop independent +!$acc loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) !$acc loop independent +!$acc loop independent independent !$acc loop seq !$acc loop vector(length: a) !$acc loop vector(length: a) vector(length: b) -!$acc loop vector(length: a) +!$acc loop vector(length: a) vector(length: a) !$acc loop vector(c) vector(length: c) !$acc loop vector(c) vector(b) -!$acc loop vector(c) +!$acc loop vector(c) vector(c) !$acc loop worker(num: a) !$acc loop worker(num: a) worker(num: b) -!$acc loop worker(num: a) +!$acc loop worker(num: a) worker(num: a) !$acc loop worker(c) worker(num: c) !$acc loop worker(c) worker(b) -!$acc loop worker(c) +!$acc loop worker(c) worker(c) !$acc loop tile(1) -!$acc loop tile(1, 2) -!$acc loop tile(1, 1, 2) -!$acc loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) -!$acc loop reduction(+ : x, y, z, a, b, c) +!$acc loop tile(1) tile(2) +!$acc loop tile(1) tile(1) tile(2) +!$acc loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) +!$acc loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) !$acc loop reduction(+ : x, y, z) reduction(* : a, b, c) !$acc loop reduction(max : x, y, z) reduction(min : a, b, c) -!$acc loop reduction(min : x, y, z, a, b, c) +!$acc loop reduction(min : x, y, z) reduction(min : a, b, c) !$acc loop reduction(min : x, y, z) reduction(&& : a, b, c) !$acc loop reduction(|| : x, y, z) reduction(&& : a, b, c) -!$acc loop reduction(&& : x, y, z, a, b, c) -!$acc loop reduction(max : x, y, max, min) +!$acc loop reduction(&& : x, y, z) reduction(&& : a, b, c) +!$acc loop reduction(max : x, y, max) reduction(max : x, y, min) !$acc loop device_type(x, y, z) !$acc loop reduction(+ : x, y, z) !$acc loop reduction(* : x, y, z) diff --git a/tests/builtin/reference/ref_parallel.txt b/tests/builtin/reference/ref_parallel.txt index 25941ce..44129bf 100644 --- a/tests/builtin/reference/ref_parallel.txt +++ b/tests/builtin/reference/ref_parallel.txt @@ -44,42 +44,42 @@ #pragma acc parallel reduction(^ : x, y, z) #pragma acc parallel reduction(&& : x, y, z) #pragma acc parallel reduction(|| : x, y, z) -#pragma acc parallel copyin(readonly: x, y, z, a, b, c) -#pragma acc parallel copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +#pragma acc parallel copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +#pragma acc parallel copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) #pragma acc parallel copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc parallel copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc parallel copyin(x, y, z, a, b, c) -#pragma acc parallel copyout(zero: x, y, z, a, b, c) -#pragma acc parallel copyout(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc parallel copyin(x, y, z) copyin(a, b, c) +#pragma acc parallel copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +#pragma acc parallel copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) #pragma acc parallel copyout(x, y, z) copyout(zero: a, b, c) #pragma acc parallel copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc parallel copyout(x, y, z, a, b, c) -#pragma acc parallel create(zero: x, y, z, a, b, c) -#pragma acc parallel create(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc parallel copyout(x, y, z) copyout(a, b, c) +#pragma acc parallel create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +#pragma acc parallel create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) #pragma acc parallel create(x, y, z) create(zero: a, b, c) #pragma acc parallel create(zero: x, y, z) create(a, b, c) -#pragma acc parallel create(x, y, z, a, b, c) -#pragma acc parallel reduction(+ : x, y, z, a, b, c) +#pragma acc parallel create(x, y, z) create(a, b, c) +#pragma acc parallel reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) #pragma acc parallel reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc parallel reduction(max : x, y, z) reduction(min : a, b, c) -#pragma acc parallel reduction(min : x, y, z, a, b, c) +#pragma acc parallel reduction(min : x, y, z) reduction(min : a, b, c) #pragma acc parallel reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc parallel reduction(|| : x, y, z) reduction(&& : a, b, c) -#pragma acc parallel reduction(&& : x, y, z, a, b, c) -#pragma acc parallel reduction(max : x, y, max, min) +#pragma acc parallel reduction(&& : x, y, z) reduction(&& : a, b, c) +#pragma acc parallel reduction(max : x, y, max) reduction(max : x, y, min) #pragma acc parallel copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) #pragma acc parallel async(expression1) async(expression2) async(expression3) -#pragma acc parallel async(expression1) async(expression2) +#pragma acc parallel async(expression1) async(expression2) async(expression1) #pragma acc parallel async(expression1) async -#pragma acc parallel async async(expression1) +#pragma acc parallel async async(expression1) async #pragma acc parallel num_workers(expression1) num_workers(expression2) num_workers(expression3) -#pragma acc parallel num_workers(expression1) num_workers(expression2) +#pragma acc parallel num_workers(expression1) num_workers(expression2) num_workers(expression1) #pragma acc parallel vector_length(expression1) vector_length(expression2) vector_length(expression3) -#pragma acc parallel vector_length(expression1) vector_length(expression2) +#pragma acc parallel vector_length(expression1) vector_length(expression2) vector_length(expression1) #pragma acc parallel self(expression1) self(expression2) self(expression3) -#pragma acc parallel self(expression1) self(expression2) +#pragma acc parallel self(expression1) self(expression2) self(expression1) #pragma acc parallel self(expression1) self -#pragma acc parallel self self(expression1) +#pragma acc parallel self self(expression1) self #pragma acc parallel num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -#pragma acc parallel num_gangs(expression1) num_gangs(expression2) -#pragma acc parallel wait wait(a, b, c, d) +#pragma acc parallel num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) +#pragma acc parallel wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) diff --git a/tests/builtin/reference/ref_parallel_fortran.txt b/tests/builtin/reference/ref_parallel_fortran.txt index ff86600..dc6abe6 100644 --- a/tests/builtin/reference/ref_parallel_fortran.txt +++ b/tests/builtin/reference/ref_parallel_fortran.txt @@ -44,44 +44,44 @@ !$acc parallel reduction(^ : x, y, z) !$acc parallel reduction(&& : x, y, z) !$acc parallel reduction(|| : x, y, z) -!$acc parallel copyin(readonly: x, y, z, a, b, c) -!$acc parallel copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +!$acc parallel copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +!$acc parallel copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) !$acc parallel copyin(x, y, z) copyin(readonly: a, b, c) !$acc parallel copyin(readonly: x, y, z) copyin(a, b, c) -!$acc parallel copyin(x, y, z, a, b, c) -!$acc parallel copyout(zero: x, y, z, a, b, c) -!$acc parallel copyout(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc parallel copyin(x, y, z) copyin(a, b, c) +!$acc parallel copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +!$acc parallel copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) !$acc parallel copyout(x, y, z) copyout(zero: a, b, c) !$acc parallel copyout(zero: x, y, z) copyout(a, b, c) -!$acc parallel copyout(x, y, z, a, b, c) -!$acc parallel create(zero: x, y, z, a, b, c) -!$acc parallel create(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc parallel copyout(x, y, z) copyout(a, b, c) +!$acc parallel create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +!$acc parallel create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) !$acc parallel create(x, y, z) create(zero: a, b, c) !$acc parallel create(zero: x, y, z) create(a, b, c) -!$acc parallel create(x, y, z, a, b, c) -!$acc parallel reduction(+ : x, y, z, a, b, c) +!$acc parallel create(x, y, z) create(a, b, c) +!$acc parallel reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) !$acc parallel reduction(+ : x, y, z) reduction(* : a, b, c) !$acc parallel reduction(max : x, y, z) reduction(min : a, b, c) -!$acc parallel reduction(min : x, y, z, a, b, c) +!$acc parallel reduction(min : x, y, z) reduction(min : a, b, c) !$acc parallel reduction(min : x, y, z) reduction(&& : a, b, c) !$acc parallel reduction(|| : x, y, z) reduction(&& : a, b, c) -!$acc parallel reduction(&& : x, y, z, a, b, c) -!$acc parallel reduction(max : x, y, max, min) +!$acc parallel reduction(&& : x, y, z) reduction(&& : a, b, c) +!$acc parallel reduction(max : x, y, max) reduction(max : x, y, min) !$acc parallel copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) !$acc parallel async(expression1) async(expression2) async(expression3) -!$acc parallel async(expression1) async(expression2) +!$acc parallel async(expression1) async(expression2) async(expression1) !$acc parallel async(expression1) async -!$acc parallel async async(expression1) +!$acc parallel async async(expression1) async !$acc parallel num_workers(expression1) num_workers(expression2) num_workers(expression3) -!$acc parallel num_workers(expression1) num_workers(expression2) +!$acc parallel num_workers(expression1) num_workers(expression2) num_workers(expression1) !$acc parallel vector_length(expression1) vector_length(expression2) vector_length(expression3) -!$acc parallel vector_length(expression1) vector_length(expression2) +!$acc parallel vector_length(expression1) vector_length(expression2) vector_length(expression1) !$acc parallel self(expression1) self(expression2) self(expression3) -!$acc parallel self(expression1) self(expression2) +!$acc parallel self(expression1) self(expression2) self(expression1) !$acc parallel self(expression1) self -!$acc parallel self self(expression1) +!$acc parallel self self(expression1) self !$acc parallel num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -!$acc parallel num_gangs(expression1) num_gangs(expression2) -!$acc parallel wait wait(a, b, c, d) +!$acc parallel num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) +!$acc parallel wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) !$acc parallel deviceptr(a, b, c) !$acc end parallel diff --git a/tests/builtin/reference/ref_parallel_loop.txt b/tests/builtin/reference/ref_parallel_loop.txt index b8abe4f..6a0b5bd 100644 --- a/tests/builtin/reference/ref_parallel_loop.txt +++ b/tests/builtin/reference/ref_parallel_loop.txt @@ -47,74 +47,74 @@ #pragma acc parallel loop reduction(^ : x, y, z) #pragma acc parallel loop reduction(&& : x, y, z) #pragma acc parallel loop reduction(|| : x, y, z) -#pragma acc parallel loop copyin(readonly: x, y, z, a, b, c) -#pragma acc parallel loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +#pragma acc parallel loop copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +#pragma acc parallel loop copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) #pragma acc parallel loop copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc parallel loop copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc parallel loop copyin(x, y, z, a, b, c) -#pragma acc parallel loop copyout(zero: x, y, z, a, b, c) -#pragma acc parallel loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc parallel loop copyin(x, y, z) copyin(a, b, c) +#pragma acc parallel loop copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +#pragma acc parallel loop copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) #pragma acc parallel loop copyout(x, y, z) copyout(zero: a, b, c) #pragma acc parallel loop copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc parallel loop copyout(x, y, z, a, b, c) -#pragma acc parallel loop create(zero: x, y, z, a, b, c) -#pragma acc parallel loop create(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc parallel loop copyout(x, y, z) copyout(a, b, c) +#pragma acc parallel loop create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +#pragma acc parallel loop create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) #pragma acc parallel loop create(x, y, z) create(zero: a, b, c) #pragma acc parallel loop create(zero: x, y, z) create(a, b, c) -#pragma acc parallel loop create(x, y, z, a, b, c) -#pragma acc parallel loop reduction(+ : x, y, z, a, b, c) +#pragma acc parallel loop create(x, y, z) create(a, b, c) +#pragma acc parallel loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) #pragma acc parallel loop reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc parallel loop reduction(max : x, y, z) reduction(min : a, b, c) -#pragma acc parallel loop reduction(min : x, y, z, a, b, c) +#pragma acc parallel loop reduction(min : x, y, z) reduction(min : a, b, c) #pragma acc parallel loop reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc parallel loop reduction(|| : x, y, z) reduction(&& : a, b, c) -#pragma acc parallel loop reduction(&& : x, y, z, a, b, c) -#pragma acc parallel loop reduction(max : x, y, max, min) +#pragma acc parallel loop reduction(&& : x, y, z) reduction(&& : a, b, c) +#pragma acc parallel loop reduction(max : x, y, max) reduction(max : x, y, min) #pragma acc parallel loop copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) #pragma acc parallel loop async(expression1) async(expression2) async(expression3) -#pragma acc parallel loop async(expression1) async(expression2) +#pragma acc parallel loop async(expression1) async(expression2) async(expression1) #pragma acc parallel loop async(expression1) async -#pragma acc parallel loop async async(expression1) +#pragma acc parallel loop async async(expression1) async #pragma acc parallel loop num_workers(expression1) num_workers(expression2) num_workers(expression3) -#pragma acc parallel loop num_workers(expression1) num_workers(expression2) +#pragma acc parallel loop num_workers(expression1) num_workers(expression2) num_workers(expression1) #pragma acc parallel loop vector_length(expression1) vector_length(expression2) vector_length(expression3) -#pragma acc parallel loop vector_length(expression1) vector_length(expression2) +#pragma acc parallel loop vector_length(expression1) vector_length(expression2) vector_length(expression1) #pragma acc parallel loop self(expression1) self(expression2) self(expression3) -#pragma acc parallel loop self(expression1) self(expression2) +#pragma acc parallel loop self(expression1) self(expression2) self(expression1) #pragma acc parallel loop self(expression1) self -#pragma acc parallel loop self self(expression1) +#pragma acc parallel loop self self(expression1) self #pragma acc parallel loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -#pragma acc parallel loop num_gangs(expression1) num_gangs(expression2) -#pragma acc parallel loop wait wait(a, b, c, d) +#pragma acc parallel loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) +#pragma acc parallel loop wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) #pragma acc parallel loop #pragma acc parallel loop private(a, b, c) #pragma acc parallel loop auto -#pragma acc parallel loop auto +#pragma acc parallel loop auto auto #pragma acc parallel loop collapse(1) #pragma acc parallel loop collapse(1) collapse(2) -#pragma acc parallel loop collapse(1) collapse(2) +#pragma acc parallel loop collapse(1) collapse(1) collapse(2) #pragma acc parallel loop device_type(a, b, c) #pragma acc parallel loop gang #pragma acc parallel loop gang(a, b, c) -#pragma acc parallel loop gang(a, b, c, d) +#pragma acc parallel loop gang(a, b, c) gang(c) gang(d) #pragma acc parallel loop gang(a, b, c) gang -#pragma acc parallel loop gang gang(a, b, c, d) -#pragma acc parallel loop independent +#pragma acc parallel loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) #pragma acc parallel loop independent +#pragma acc parallel loop independent independent #pragma acc parallel loop seq #pragma acc parallel loop vector(length: a) #pragma acc parallel loop vector(length: a) vector(length: b) -#pragma acc parallel loop vector(length: a) +#pragma acc parallel loop vector(length: a) vector(length: a) #pragma acc parallel loop vector(c) vector(length: c) #pragma acc parallel loop vector(c) vector(b) -#pragma acc parallel loop vector(c) +#pragma acc parallel loop vector(c) vector(c) #pragma acc parallel loop worker(num: a) #pragma acc parallel loop worker(num: a) worker(num: b) -#pragma acc parallel loop worker(num: a) +#pragma acc parallel loop worker(num: a) worker(num: a) #pragma acc parallel loop worker(c) worker(num: c) #pragma acc parallel loop worker(c) worker(b) -#pragma acc parallel loop worker(c) +#pragma acc parallel loop worker(c) worker(c) #pragma acc parallel loop tile(1) -#pragma acc parallel loop tile(1, 2) -#pragma acc parallel loop tile(1, 1, 2) -#pragma acc parallel loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) +#pragma acc parallel loop tile(1) tile(2) +#pragma acc parallel loop tile(1) tile(1) tile(2) +#pragma acc parallel loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) diff --git a/tests/builtin/reference/ref_parallel_loop_fortran.txt b/tests/builtin/reference/ref_parallel_loop_fortran.txt index eb97c4c..23f61f0 100644 --- a/tests/builtin/reference/ref_parallel_loop_fortran.txt +++ b/tests/builtin/reference/ref_parallel_loop_fortran.txt @@ -47,75 +47,75 @@ !$acc parallel loop reduction(^ : x, y, z) !$acc parallel loop reduction(&& : x, y, z) !$acc parallel loop reduction(|| : x, y, z) -!$acc parallel loop copyin(readonly: x, y, z, a, b, c) -!$acc parallel loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +!$acc parallel loop copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +!$acc parallel loop copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) !$acc parallel loop copyin(x, y, z) copyin(readonly: a, b, c) !$acc parallel loop copyin(readonly: x, y, z) copyin(a, b, c) -!$acc parallel loop copyin(x, y, z, a, b, c) -!$acc parallel loop copyout(zero: x, y, z, a, b, c) -!$acc parallel loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc parallel loop copyin(x, y, z) copyin(a, b, c) +!$acc parallel loop copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +!$acc parallel loop copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) !$acc parallel loop copyout(x, y, z) copyout(zero: a, b, c) !$acc parallel loop copyout(zero: x, y, z) copyout(a, b, c) -!$acc parallel loop copyout(x, y, z, a, b, c) -!$acc parallel loop create(zero: x, y, z, a, b, c) -!$acc parallel loop create(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc parallel loop copyout(x, y, z) copyout(a, b, c) +!$acc parallel loop create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +!$acc parallel loop create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) !$acc parallel loop create(x, y, z) create(zero: a, b, c) !$acc parallel loop create(zero: x, y, z) create(a, b, c) -!$acc parallel loop create(x, y, z, a, b, c) -!$acc parallel loop reduction(+ : x, y, z, a, b, c) +!$acc parallel loop create(x, y, z) create(a, b, c) +!$acc parallel loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) !$acc parallel loop reduction(+ : x, y, z) reduction(* : a, b, c) !$acc parallel loop reduction(max : x, y, z) reduction(min : a, b, c) -!$acc parallel loop reduction(min : x, y, z, a, b, c) +!$acc parallel loop reduction(min : x, y, z) reduction(min : a, b, c) !$acc parallel loop reduction(min : x, y, z) reduction(&& : a, b, c) !$acc parallel loop reduction(|| : x, y, z) reduction(&& : a, b, c) -!$acc parallel loop reduction(&& : x, y, z, a, b, c) -!$acc parallel loop reduction(max : x, y, max, min) +!$acc parallel loop reduction(&& : x, y, z) reduction(&& : a, b, c) +!$acc parallel loop reduction(max : x, y, max) reduction(max : x, y, min) !$acc parallel loop copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) !$acc parallel loop async(expression1) async(expression2) async(expression3) -!$acc parallel loop async(expression1) async(expression2) +!$acc parallel loop async(expression1) async(expression2) async(expression1) !$acc parallel loop async(expression1) async -!$acc parallel loop async async(expression1) +!$acc parallel loop async async(expression1) async !$acc parallel loop num_workers(expression1) num_workers(expression2) num_workers(expression3) -!$acc parallel loop num_workers(expression1) num_workers(expression2) +!$acc parallel loop num_workers(expression1) num_workers(expression2) num_workers(expression1) !$acc parallel loop vector_length(expression1) vector_length(expression2) vector_length(expression3) -!$acc parallel loop vector_length(expression1) vector_length(expression2) +!$acc parallel loop vector_length(expression1) vector_length(expression2) vector_length(expression1) !$acc parallel loop self(expression1) self(expression2) self(expression3) -!$acc parallel loop self(expression1) self(expression2) +!$acc parallel loop self(expression1) self(expression2) self(expression1) !$acc parallel loop self(expression1) self -!$acc parallel loop self self(expression1) +!$acc parallel loop self self(expression1) self !$acc parallel loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -!$acc parallel loop num_gangs(expression1) num_gangs(expression2) -!$acc parallel loop wait wait(a, b, c, d) +!$acc parallel loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) +!$acc parallel loop wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) !$acc parallel loop !$acc parallel loop private(a, b, c) !$acc parallel loop auto -!$acc parallel loop auto +!$acc parallel loop auto auto !$acc parallel loop collapse(1) !$acc parallel loop collapse(1) collapse(2) -!$acc parallel loop collapse(1) collapse(2) +!$acc parallel loop collapse(1) collapse(1) collapse(2) !$acc parallel loop device_type(a, b, c) !$acc parallel loop gang !$acc parallel loop gang(a, b, c) -!$acc parallel loop gang(a, b, c, d) +!$acc parallel loop gang(a, b, c) gang(c) gang(d) !$acc parallel loop gang(a, b, c) gang -!$acc parallel loop gang gang(a, b, c, d) -!$acc parallel loop independent +!$acc parallel loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) !$acc parallel loop independent +!$acc parallel loop independent independent !$acc parallel loop seq !$acc parallel loop vector(length: a) !$acc parallel loop vector(length: a) vector(length: b) -!$acc parallel loop vector(length: a) +!$acc parallel loop vector(length: a) vector(length: a) !$acc parallel loop vector(c) vector(length: c) !$acc parallel loop vector(c) vector(b) -!$acc parallel loop vector(c) +!$acc parallel loop vector(c) vector(c) !$acc parallel loop worker(num: a) !$acc parallel loop worker(num: a) worker(num: b) -!$acc parallel loop worker(num: a) +!$acc parallel loop worker(num: a) worker(num: a) !$acc parallel loop worker(c) worker(num: c) !$acc parallel loop worker(c) worker(b) -!$acc parallel loop worker(c) +!$acc parallel loop worker(c) worker(c) !$acc parallel loop tile(1) -!$acc parallel loop tile(1, 2) -!$acc parallel loop tile(1, 1, 2) -!$acc parallel loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) +!$acc parallel loop tile(1) tile(2) +!$acc parallel loop tile(1) tile(1) tile(2) +!$acc parallel loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) !$acc end parallel loop diff --git a/tests/builtin/reference/ref_routine.txt b/tests/builtin/reference/ref_routine.txt index deec741..677a723 100644 --- a/tests/builtin/reference/ref_routine.txt +++ b/tests/builtin/reference/ref_routine.txt @@ -11,4 +11,4 @@ #pragma acc routine nohost #pragma acc routine bind(expression1) #pragma acc routine bind(expression1) bind(expression2) -#pragma acc routine bind(expression1) +#pragma acc routine bind(expression1) bind(expression1) diff --git a/tests/builtin/reference/ref_routine_fortran.txt b/tests/builtin/reference/ref_routine_fortran.txt index ad0c372..59bda2b 100644 --- a/tests/builtin/reference/ref_routine_fortran.txt +++ b/tests/builtin/reference/ref_routine_fortran.txt @@ -11,4 +11,4 @@ !$acc routine nohost !$acc routine bind(expression1) !$acc routine bind(expression1) bind(expression2) -!$acc routine bind(expression1) +!$acc routine bind(expression1) bind(expression1) diff --git a/tests/builtin/reference/ref_serial.txt b/tests/builtin/reference/ref_serial.txt index 20665e0..5f29962 100644 --- a/tests/builtin/reference/ref_serial.txt +++ b/tests/builtin/reference/ref_serial.txt @@ -41,35 +41,35 @@ #pragma acc serial reduction(^ : x, y, z) #pragma acc serial reduction(&& : x, y, z) #pragma acc serial reduction(|| : x, y, z) -#pragma acc serial copyin(readonly: x, y, z, a, b, c) -#pragma acc serial copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +#pragma acc serial copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +#pragma acc serial copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) #pragma acc serial copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc serial copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc serial copyin(x, y, z, a, b, c) -#pragma acc serial copyout(zero: x, y, z, a, b, c) -#pragma acc serial copyout(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc serial copyin(x, y, z) copyin(a, b, c) +#pragma acc serial copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +#pragma acc serial copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) #pragma acc serial copyout(x, y, z) copyout(zero: a, b, c) #pragma acc serial copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc serial copyout(x, y, z, a, b, c) -#pragma acc serial create(zero: x, y, z, a, b, c) -#pragma acc serial create(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc serial copyout(x, y, z) copyout(a, b, c) +#pragma acc serial create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +#pragma acc serial create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) #pragma acc serial create(x, y, z) create(zero: a, b, c) #pragma acc serial create(zero: x, y, z) create(a, b, c) -#pragma acc serial create(x, y, z, a, b, c) -#pragma acc serial reduction(+ : x, y, z, a, b, c) +#pragma acc serial create(x, y, z) create(a, b, c) +#pragma acc serial reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) #pragma acc serial reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc serial reduction(max : x, y, z) reduction(min : a, b, c) -#pragma acc serial reduction(min : x, y, z, a, b, c) +#pragma acc serial reduction(min : x, y, z) reduction(min : a, b, c) #pragma acc serial reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc serial reduction(|| : x, y, z) reduction(&& : a, b, c) -#pragma acc serial reduction(&& : x, y, z, a, b, c) -#pragma acc serial reduction(max : x, y, max, min) +#pragma acc serial reduction(&& : x, y, z) reduction(&& : a, b, c) +#pragma acc serial reduction(max : x, y, max) reduction(max : x, y, min) #pragma acc serial copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) #pragma acc serial async(expression1) async(expression2) async(expression3) -#pragma acc serial async(expression1) async(expression2) +#pragma acc serial async(expression1) async(expression2) async(expression1) #pragma acc serial async(expression1) async -#pragma acc serial async async(expression1) +#pragma acc serial async async(expression1) async #pragma acc serial self(expression1) self(expression2) self(expression3) -#pragma acc serial self(expression1) self(expression2) +#pragma acc serial self(expression1) self(expression2) self(expression1) #pragma acc serial self(expression1) self -#pragma acc serial self self(expression1) +#pragma acc serial self self(expression1) self diff --git a/tests/builtin/reference/ref_serial_fortran.txt b/tests/builtin/reference/ref_serial_fortran.txt index 4b34d97..7303d45 100644 --- a/tests/builtin/reference/ref_serial_fortran.txt +++ b/tests/builtin/reference/ref_serial_fortran.txt @@ -41,36 +41,36 @@ !$acc serial reduction(^ : x, y, z) !$acc serial reduction(&& : x, y, z) !$acc serial reduction(|| : x, y, z) -!$acc serial copyin(readonly: x, y, z, a, b, c) -!$acc serial copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +!$acc serial copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +!$acc serial copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) !$acc serial copyin(x, y, z) copyin(readonly: a, b, c) !$acc serial copyin(readonly: x, y, z) copyin(a, b, c) -!$acc serial copyin(x, y, z, a, b, c) -!$acc serial copyout(zero: x, y, z, a, b, c) -!$acc serial copyout(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc serial copyin(x, y, z) copyin(a, b, c) +!$acc serial copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +!$acc serial copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) !$acc serial copyout(x, y, z) copyout(zero: a, b, c) !$acc serial copyout(zero: x, y, z) copyout(a, b, c) -!$acc serial copyout(x, y, z, a, b, c) -!$acc serial create(zero: x, y, z, a, b, c) -!$acc serial create(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc serial copyout(x, y, z) copyout(a, b, c) +!$acc serial create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +!$acc serial create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) !$acc serial create(x, y, z) create(zero: a, b, c) !$acc serial create(zero: x, y, z) create(a, b, c) -!$acc serial create(x, y, z, a, b, c) -!$acc serial reduction(+ : x, y, z, a, b, c) +!$acc serial create(x, y, z) create(a, b, c) +!$acc serial reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) !$acc serial reduction(+ : x, y, z) reduction(* : a, b, c) !$acc serial reduction(max : x, y, z) reduction(min : a, b, c) -!$acc serial reduction(min : x, y, z, a, b, c) +!$acc serial reduction(min : x, y, z) reduction(min : a, b, c) !$acc serial reduction(min : x, y, z) reduction(&& : a, b, c) !$acc serial reduction(|| : x, y, z) reduction(&& : a, b, c) -!$acc serial reduction(&& : x, y, z, a, b, c) -!$acc serial reduction(max : x, y, max, min) +!$acc serial reduction(&& : x, y, z) reduction(&& : a, b, c) +!$acc serial reduction(max : x, y, max) reduction(max : x, y, min) !$acc serial copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) !$acc serial async(expression1) async(expression2) async(expression3) -!$acc serial async(expression1) async(expression2) +!$acc serial async(expression1) async(expression2) async(expression1) !$acc serial async(expression1) async -!$acc serial async async(expression1) +!$acc serial async async(expression1) async !$acc serial self(expression1) self(expression2) self(expression3) -!$acc serial self(expression1) self(expression2) +!$acc serial self(expression1) self(expression2) self(expression1) !$acc serial self(expression1) self -!$acc serial self self(expression1) +!$acc serial self self(expression1) self !$acc end serial diff --git a/tests/builtin/reference/ref_serial_loop.txt b/tests/builtin/reference/ref_serial_loop.txt index cb8a2e7..51380c5 100644 --- a/tests/builtin/reference/ref_serial_loop.txt +++ b/tests/builtin/reference/ref_serial_loop.txt @@ -41,67 +41,67 @@ #pragma acc serial loop reduction(^ : x, y, z) #pragma acc serial loop reduction(&& : x, y, z) #pragma acc serial loop reduction(|| : x, y, z) -#pragma acc serial loop copyin(readonly: x, y, z, a, b, c) -#pragma acc serial loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +#pragma acc serial loop copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +#pragma acc serial loop copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) #pragma acc serial loop copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc serial loop copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc serial loop copyin(x, y, z, a, b, c) -#pragma acc serial loop copyout(zero: x, y, z, a, b, c) -#pragma acc serial loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc serial loop copyin(x, y, z) copyin(a, b, c) +#pragma acc serial loop copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +#pragma acc serial loop copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) #pragma acc serial loop copyout(x, y, z) copyout(zero: a, b, c) #pragma acc serial loop copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc serial loop copyout(x, y, z, a, b, c) -#pragma acc serial loop create(zero: x, y, z, a, b, c) -#pragma acc serial loop create(zero: x, y, z, a, b, c, 1, 2, 3) +#pragma acc serial loop copyout(x, y, z) copyout(a, b, c) +#pragma acc serial loop create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +#pragma acc serial loop create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) #pragma acc serial loop create(x, y, z) create(zero: a, b, c) #pragma acc serial loop create(zero: x, y, z) create(a, b, c) -#pragma acc serial loop create(x, y, z, a, b, c) -#pragma acc serial loop reduction(+ : x, y, z, a, b, c) +#pragma acc serial loop create(x, y, z) create(a, b, c) +#pragma acc serial loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) #pragma acc serial loop reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc serial loop reduction(max : x, y, z) reduction(min : a, b, c) -#pragma acc serial loop reduction(min : x, y, z, a, b, c) +#pragma acc serial loop reduction(min : x, y, z) reduction(min : a, b, c) #pragma acc serial loop reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc serial loop reduction(|| : x, y, z) reduction(&& : a, b, c) -#pragma acc serial loop reduction(&& : x, y, z, a, b, c) -#pragma acc serial loop reduction(max : x, y, max, min) +#pragma acc serial loop reduction(&& : x, y, z) reduction(&& : a, b, c) +#pragma acc serial loop reduction(max : x, y, max) reduction(max : x, y, min) #pragma acc serial loop copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) #pragma acc serial loop async(expression1) async(expression2) async(expression3) -#pragma acc serial loop async(expression1) async(expression2) +#pragma acc serial loop async(expression1) async(expression2) async(expression1) #pragma acc serial loop async(expression1) async -#pragma acc serial loop async async(expression1) +#pragma acc serial loop async async(expression1) async #pragma acc serial loop self(expression1) self(expression2) self(expression3) -#pragma acc serial loop self(expression1) self(expression2) +#pragma acc serial loop self(expression1) self(expression2) self(expression1) #pragma acc serial loop self(expression1) self -#pragma acc serial loop self self(expression1) +#pragma acc serial loop self self(expression1) self #pragma acc serial loop #pragma acc serial loop private(a, b, c) #pragma acc serial loop auto -#pragma acc serial loop auto +#pragma acc serial loop auto auto #pragma acc serial loop collapse(1) #pragma acc serial loop collapse(1) collapse(2) -#pragma acc serial loop collapse(1) collapse(2) +#pragma acc serial loop collapse(1) collapse(1) collapse(2) #pragma acc serial loop device_type(a, b, c) #pragma acc serial loop gang #pragma acc serial loop gang(a, b, c) -#pragma acc serial loop gang(a, b, c, d) +#pragma acc serial loop gang(a, b, c) gang(c) gang(d) #pragma acc serial loop gang(a, b, c) gang -#pragma acc serial loop gang gang(a, b, c, d) -#pragma acc serial loop independent +#pragma acc serial loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) #pragma acc serial loop independent +#pragma acc serial loop independent independent #pragma acc serial loop seq #pragma acc serial loop vector(length: a) #pragma acc serial loop vector(length: a) vector(length: b) -#pragma acc serial loop vector(length: a) +#pragma acc serial loop vector(length: a) vector(length: a) #pragma acc serial loop vector(c) vector(length: c) #pragma acc serial loop vector(c) vector(b) -#pragma acc serial loop vector(c) +#pragma acc serial loop vector(c) vector(c) #pragma acc serial loop worker(num: a) #pragma acc serial loop worker(num: a) worker(num: b) -#pragma acc serial loop worker(num: a) +#pragma acc serial loop worker(num: a) worker(num: a) #pragma acc serial loop worker(c) worker(num: c) #pragma acc serial loop worker(c) worker(b) -#pragma acc serial loop worker(c) +#pragma acc serial loop worker(c) worker(c) #pragma acc serial loop tile(1) -#pragma acc serial loop tile(1, 2) -#pragma acc serial loop tile(1, 1, 2) -#pragma acc serial loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) +#pragma acc serial loop tile(1) tile(2) +#pragma acc serial loop tile(1) tile(1) tile(2) +#pragma acc serial loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) diff --git a/tests/builtin/reference/ref_serial_loop_fortran.txt b/tests/builtin/reference/ref_serial_loop_fortran.txt index 8d5fb4f..d12ec11 100644 --- a/tests/builtin/reference/ref_serial_loop_fortran.txt +++ b/tests/builtin/reference/ref_serial_loop_fortran.txt @@ -41,68 +41,68 @@ !$acc serial loop reduction(^ : x, y, z) !$acc serial loop reduction(&& : x, y, z) !$acc serial loop reduction(|| : x, y, z) -!$acc serial loop copyin(readonly: x, y, z, a, b, c) -!$acc serial loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) +!$acc serial loop copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) +!$acc serial loop copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) !$acc serial loop copyin(x, y, z) copyin(readonly: a, b, c) !$acc serial loop copyin(readonly: x, y, z) copyin(a, b, c) -!$acc serial loop copyin(x, y, z, a, b, c) -!$acc serial loop copyout(zero: x, y, z, a, b, c) -!$acc serial loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc serial loop copyin(x, y, z) copyin(a, b, c) +!$acc serial loop copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) +!$acc serial loop copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) !$acc serial loop copyout(x, y, z) copyout(zero: a, b, c) !$acc serial loop copyout(zero: x, y, z) copyout(a, b, c) -!$acc serial loop copyout(x, y, z, a, b, c) -!$acc serial loop create(zero: x, y, z, a, b, c) -!$acc serial loop create(zero: x, y, z, a, b, c, 1, 2, 3) +!$acc serial loop copyout(x, y, z) copyout(a, b, c) +!$acc serial loop create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) +!$acc serial loop create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) !$acc serial loop create(x, y, z) create(zero: a, b, c) !$acc serial loop create(zero: x, y, z) create(a, b, c) -!$acc serial loop create(x, y, z, a, b, c) -!$acc serial loop reduction(+ : x, y, z, a, b, c) +!$acc serial loop create(x, y, z) create(a, b, c) +!$acc serial loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) !$acc serial loop reduction(+ : x, y, z) reduction(* : a, b, c) !$acc serial loop reduction(max : x, y, z) reduction(min : a, b, c) -!$acc serial loop reduction(min : x, y, z, a, b, c) +!$acc serial loop reduction(min : x, y, z) reduction(min : a, b, c) !$acc serial loop reduction(min : x, y, z) reduction(&& : a, b, c) !$acc serial loop reduction(|| : x, y, z) reduction(&& : a, b, c) -!$acc serial loop reduction(&& : x, y, z, a, b, c) -!$acc serial loop reduction(max : x, y, max, min) +!$acc serial loop reduction(&& : x, y, z) reduction(&& : a, b, c) +!$acc serial loop reduction(max : x, y, max) reduction(max : x, y, min) !$acc serial loop copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) !$acc serial loop async(expression1) async(expression2) async(expression3) -!$acc serial loop async(expression1) async(expression2) +!$acc serial loop async(expression1) async(expression2) async(expression1) !$acc serial loop async(expression1) async -!$acc serial loop async async(expression1) +!$acc serial loop async async(expression1) async !$acc serial loop self(expression1) self(expression2) self(expression3) -!$acc serial loop self(expression1) self(expression2) +!$acc serial loop self(expression1) self(expression2) self(expression1) !$acc serial loop self(expression1) self -!$acc serial loop self self(expression1) +!$acc serial loop self self(expression1) self !$acc serial loop !$acc serial loop private(a, b, c) !$acc serial loop auto -!$acc serial loop auto +!$acc serial loop auto auto !$acc serial loop collapse(1) !$acc serial loop collapse(1) collapse(2) -!$acc serial loop collapse(1) collapse(2) +!$acc serial loop collapse(1) collapse(1) collapse(2) !$acc serial loop device_type(a, b, c) !$acc serial loop gang !$acc serial loop gang(a, b, c) -!$acc serial loop gang(a, b, c, d) +!$acc serial loop gang(a, b, c) gang(c) gang(d) !$acc serial loop gang(a, b, c) gang -!$acc serial loop gang gang(a, b, c, d) -!$acc serial loop independent +!$acc serial loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) !$acc serial loop independent +!$acc serial loop independent independent !$acc serial loop seq !$acc serial loop vector(length: a) !$acc serial loop vector(length: a) vector(length: b) -!$acc serial loop vector(length: a) +!$acc serial loop vector(length: a) vector(length: a) !$acc serial loop vector(c) vector(length: c) !$acc serial loop vector(c) vector(b) -!$acc serial loop vector(c) +!$acc serial loop vector(c) vector(c) !$acc serial loop worker(num: a) !$acc serial loop worker(num: a) worker(num: b) -!$acc serial loop worker(num: a) +!$acc serial loop worker(num: a) worker(num: a) !$acc serial loop worker(c) worker(num: c) !$acc serial loop worker(c) worker(b) -!$acc serial loop worker(c) +!$acc serial loop worker(c) worker(c) !$acc serial loop tile(1) -!$acc serial loop tile(1, 2) -!$acc serial loop tile(1, 1, 2) -!$acc serial loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) +!$acc serial loop tile(1) tile(2) +!$acc serial loop tile(1) tile(1) tile(2) +!$acc serial loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) !$acc end serial loop diff --git a/tests/builtin/reference/ref_set.txt b/tests/builtin/reference/ref_set.txt index d1e2a99..148e1c0 100644 --- a/tests/builtin/reference/ref_set.txt +++ b/tests/builtin/reference/ref_set.txt @@ -1,6 +1,6 @@ #pragma acc set default_async(3) -#pragma acc set default_async(3) default_async(4) +#pragma acc set default_async(3) default_async(3) default_async(4) #pragma acc set device_type(a, b, c) #pragma acc set if(5) #pragma acc set if(x==3) -#pragma acc set device_num(3) device_num(4) +#pragma acc set device_num(3) device_num(3) device_num(4) diff --git a/tests/builtin/reference/ref_set_fortran.txt b/tests/builtin/reference/ref_set_fortran.txt index f9e2bef..6e4796f 100644 --- a/tests/builtin/reference/ref_set_fortran.txt +++ b/tests/builtin/reference/ref_set_fortran.txt @@ -1,6 +1,6 @@ !$acc set default_async(3) -!$acc set default_async(3) default_async(4) +!$acc set default_async(3) default_async(3) default_async(4) !$acc set device_type(a, b, c) !$acc set if(5) !$acc set if(x==3) -!$acc set device_num(3) device_num(4) +!$acc set device_num(3) device_num(3) device_num(4) diff --git a/tests/builtin/reference/ref_update.txt b/tests/builtin/reference/ref_update.txt index b032239..1a4be4d 100644 --- a/tests/builtin/reference/ref_update.txt +++ b/tests/builtin/reference/ref_update.txt @@ -1,23 +1,23 @@ #pragma acc update async(5) #pragma acc update async(expression1) async(expression2) async(expression3) -#pragma acc update async(expression1) async(expression2) +#pragma acc update async(expression1) async(expression2) async(expression1) #pragma acc update async(expression1) async -#pragma acc update async async(expression1) +#pragma acc update async async(expression1) async #pragma acc update device_type(x, y, z) #pragma acc update wait(queues::a, devnum::b, devnum::queues::c) -#pragma acc update wait(queues::a, devnum::b, devnum::queues::c, queues::b) -#pragma acc update wait(queues::a, devnum::b, devnum::queues::c) +#pragma acc update wait(queues::a, devnum::b, devnum::queues::c) wait(queues::b, devnum::b, devnum::queues::c) +#pragma acc update wait(queues::a, devnum::b, devnum::queues::c) wait(queues::a, devnum::b, devnum::queues::c) #pragma acc update wait(queues: 12, 23, 34) -#pragma acc update wait(queues: 12, 23, 34, 35) +#pragma acc update wait(queues: 12, 23, 34) wait(queues: 12, 23, 34) wait(queues: 12, 23, 35) #pragma acc update wait(devnum: 12: queues: 23, 34) #pragma acc update wait(devnum: 12: queues: 23, 34) wait(devnum: 13: queues: 23, 34) -#pragma acc update wait(devnum: 12: queues: 23, 34, 38) +#pragma acc update wait(devnum: 12: queues: 23, 34) wait(devnum: 12: queues: 23, 38) #pragma acc update wait(devnum: devnum::devnum::z: 23, 34) -#pragma acc update wait(23, 34, 35) -#pragma acc update wait +#pragma acc update wait(23, 34) wait(23, 34, 35) +#pragma acc update wait wait #pragma acc update if(5) #pragma acc update if(x==3) #pragma acc update host(x, y) -#pragma acc update device(x, y) -#pragma acc update device(x, y) -#pragma acc update self(x, y, z) +#pragma acc update device(x, y) device(x, y) +#pragma acc update device(x, y) device(x, y) device(x, y) +#pragma acc update self(x, y) self(x, y) self(x, y, z) diff --git a/tests/builtin/reference/ref_update_fortran.txt b/tests/builtin/reference/ref_update_fortran.txt index e10169e..54b1f13 100644 --- a/tests/builtin/reference/ref_update_fortran.txt +++ b/tests/builtin/reference/ref_update_fortran.txt @@ -1,23 +1,23 @@ !$acc update async(5) !$acc update async(expression1) async(expression2) async(expression3) -!$acc update async(expression1) async(expression2) +!$acc update async(expression1) async(expression2) async(expression1) !$acc update async(expression1) async -!$acc update async async(expression1) +!$acc update async async(expression1) async !$acc update device_type(x, y, z) !$acc update wait(queues::a, devnum::b, devnum::queues::c) -!$acc update wait(queues::a, devnum::b, devnum::queues::c, queues::b) -!$acc update wait(queues::a, devnum::b, devnum::queues::c) +!$acc update wait(queues::a, devnum::b, devnum::queues::c) wait(queues::b, devnum::b, devnum::queues::c) +!$acc update wait(queues::a, devnum::b, devnum::queues::c) wait(queues::a, devnum::b, devnum::queues::c) !$acc update wait(queues: 12, 23, 34) -!$acc update wait(queues: 12, 23, 34, 35) +!$acc update wait(queues: 12, 23, 34) wait(queues: 12, 23, 34) wait(queues: 12, 23, 35) !$acc update wait(devnum: 12: queues: 23, 34) !$acc update wait(devnum: 12: queues: 23, 34) wait(devnum: 13: queues: 23, 34) -!$acc update wait(devnum: 12: queues: 23, 34, 38) +!$acc update wait(devnum: 12: queues: 23, 34) wait(devnum: 12: queues: 23, 38) !$acc update wait(devnum: devnum::devnum::z: 23, 34) -!$acc update wait(23, 34, 35) -!$acc update wait +!$acc update wait(23, 34) wait(23, 34, 35) +!$acc update wait wait !$acc update if(5) !$acc update if(x==3) !$acc update host(x, y) -!$acc update device(x, y) -!$acc update device(x, y) -!$acc update self(x, y, z) +!$acc update device(x, y) device(x, y) +!$acc update device(x, y) device(x, y) device(x, y) +!$acc update self(x, y) self(x, y) self(x, y, z) From 4ce8393040d1ad2421689399c11c0a2cdb076eea Mon Sep 17 00:00:00 2001 From: Anjia Wang Date: Mon, 24 Nov 2025 04:59:50 +0000 Subject: [PATCH 2/6] Refactor clause payloads to typed expressions --- .github/workflows/accparser.yml | 5 +- src/OpenACCIR.cpp | 119 +++++++------- src/OpenACCIR.h | 265 +++++++++++++++++++++----------- src/OpenACCIRToString.cpp | 127 +++++++-------- 4 files changed, 314 insertions(+), 202 deletions(-) diff --git a/.github/workflows/accparser.yml b/.github/workflows/accparser.yml index f1e5104..91e348a 100644 --- a/.github/workflows/accparser.yml +++ b/.github/workflows/accparser.yml @@ -8,6 +8,10 @@ on: branches: - main +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + jobs: build-llvm: strategy: @@ -103,4 +107,3 @@ jobs: run: | cd $GITHUB_WORKSPACE/build ctest -R "^openacc_vv_" --output-on-failure - diff --git a/src/OpenACCIR.cpp b/src/OpenACCIR.cpp index c854b7a..474de7e 100644 --- a/src/OpenACCIR.cpp +++ b/src/OpenACCIR.cpp @@ -6,12 +6,9 @@ // occurrences and ordering. bool OpenACCDirective::enable_clause_merging = false; -void OpenACCClause::addLangExpr(std::string expression, - OpenACCClauseSeparator sep, int line, - int col) { +void OpenACCClause::addLangExpr(const OpenACCExpressionItem &expression, + int line, int col) { expressions.push_back(expression); - expression_separators.push_back(sep); - locations.push_back(ACC_SourceLocation(line, col)); }; @@ -274,7 +271,7 @@ void OpenACCAsyncClause::mergeClause(OpenACCDirective *directive, ++it) { auto *existing = static_cast(*it); if (incoming->getModifier() == existing->getModifier() && - incoming->getAsyncExpr() == existing->getAsyncExpr()) { + incoming->getAsyncExpr().text == existing->getAsyncExpr().text) { current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); delete incoming; @@ -320,7 +317,7 @@ void OpenACCBindClause::mergeClause(OpenACCDirective *directive, for (auto it = current_clauses->begin(); it != current_clauses->end() - 1; ++it) { auto *existing = static_cast(*it); - if (existing->getBinding() == incoming->getBinding() && + if (existing->getBinding().text == incoming->getBinding().text && existing->isStringLiteral() == incoming->isStringLiteral()) { current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); @@ -374,7 +371,7 @@ void OpenACCCollapseClause::mergeClause(OpenACCDirective *directive, for (const auto &count : incoming->getCounts()) { bool found = false; for (const auto &prev : existing->getCounts()) { - if (prev == count) { + if (prev.text == count.text) { found = true; break; } @@ -1055,7 +1052,7 @@ void OpenACCDefaultAsyncClause::mergeClause(OpenACCDirective *directive, for (auto it = current_clauses->begin(); it != current_clauses->end() - 1; ++it) { auto *existing = static_cast(*it); - if (incoming->getAsyncExpr() == existing->getAsyncExpr()) { + if (incoming->getAsyncExpr().text == existing->getAsyncExpr().text) { current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); delete incoming; @@ -1100,9 +1097,14 @@ void OpenACCDeviceClause::mergeClause(OpenACCDirective *directive, auto *existing = static_cast(current_clauses->front()); for (const auto &dev : incoming->getDevices()) { - if (std::find(existing->getDevices().begin(), - existing->getDevices().end(), - dev) == existing->getDevices().end()) { + bool found = false; + for (const auto &prev : existing->getDevices()) { + if (prev.text == dev.text) { + found = true; + break; + } + } + if (!found) { existing->addDevice(dev); } } @@ -1148,7 +1150,8 @@ void OpenACCIfClause::mergeClause(OpenACCDirective *directive, auto *incoming = static_cast(current_clause); auto *existing = static_cast(current_clauses->front()); - if (!incoming->getCondition().empty() && existing->getCondition().empty()) { + if (!incoming->getCondition().text.empty() && + existing->getCondition().text.empty()) { existing->setCondition(incoming->getCondition()); } @@ -1192,7 +1195,7 @@ void OpenACCDeviceNumClause::mergeClause(OpenACCDirective *directive, it != current_clauses->end() - 1; it++) { auto *existing = static_cast(*it); auto *incoming = static_cast(current_clause); - if (existing->getDeviceExpr() == incoming->getDeviceExpr()) { + if (existing->getDeviceExpr().text == incoming->getDeviceExpr().text) { current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); delete incoming; @@ -1338,7 +1341,7 @@ void OpenACCGangClause::mergeClause(OpenACCDirective *directive, for (const auto &arg : incoming->getArgs()) { bool found = false; for (const auto &prev : existing->getArgs()) { - if (prev.kind == arg.kind && prev.value == arg.value) { + if (prev.kind == arg.kind && prev.value.text == arg.value.text) { found = true; break; } @@ -1373,7 +1376,18 @@ void OpenACCNumGangsClause::mergeClause(OpenACCDirective *directive, for (auto it = current_clauses->begin(); it != current_clauses->end() - 1; ++it) { auto *existing = static_cast(*it); - if (existing->getNums() == incoming->getNums()) { + const auto &existing_nums = existing->getNums(); + const auto &incoming_nums = incoming->getNums(); + bool same = existing_nums.size() == incoming_nums.size(); + if (same) { + for (size_t idx = 0; idx < existing_nums.size(); ++idx) { + if (existing_nums[idx].text != incoming_nums[idx].text) { + same = false; + break; + } + } + } + if (same) { current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); delete incoming; @@ -1420,7 +1434,7 @@ void OpenACCNumWorkersClause::mergeClause(OpenACCDirective *directive, for (auto it = current_clauses->begin(); it != current_clauses->end() - 1; ++it) { auto *existing = static_cast(*it); - if (existing->getNumExpr() == incoming->getNumExpr()) { + if (existing->getNumExpr().text == incoming->getNumExpr().text) { current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); delete incoming; @@ -1506,15 +1520,15 @@ void OpenACCSelfClause::mergeClause(OpenACCDirective *directive, } auto *incoming = static_cast(current_clause); - const bool incoming_has_condition = !incoming->getCondition().empty(); + const bool incoming_has_condition = !incoming->getCondition().text.empty(); for (auto it = current_clauses->begin(); it != current_clauses->end() - 1; ++it) { auto *existing = static_cast(*it); - const bool existing_has_condition = !existing->getCondition().empty(); + const bool existing_has_condition = !existing->getCondition().text.empty(); if (incoming_has_condition && existing_has_condition) { - if (incoming->getCondition() == existing->getCondition()) { + if (incoming->getCondition().text == existing->getCondition().text) { current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); delete incoming; @@ -1594,7 +1608,7 @@ void OpenACCVectorClause::mergeClause(OpenACCDirective *directive, ++it) { auto *existing = static_cast(*it); if (existing->getModifier() == incoming->getModifier() && - existing->getLengthExpr() == incoming->getLengthExpr()) { + existing->getLengthExpr().text == incoming->getLengthExpr().text) { current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); delete incoming; @@ -1653,7 +1667,7 @@ void OpenACCVectorLengthClause::mergeClause(OpenACCDirective *directive, for (auto it = current_clauses->begin(); it != current_clauses->end() - 1; ++it) { auto *existing = static_cast(*it); - if (existing->getLengthExpr() == incoming->getLengthExpr()) { + if (existing->getLengthExpr().text == incoming->getLengthExpr().text) { current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); delete incoming; @@ -1694,40 +1708,41 @@ void OpenACCWaitClause::mergeClause(OpenACCDirective *directive, return; } - auto *incoming = static_cast(current_clause); - for (auto it = current_clauses->begin(); it != current_clauses->end() - 1; - ++it) { - auto *existing = static_cast(*it); - if (incoming->getDevnum() == existing->getDevnum() && - incoming->getQueues() == existing->getQueues()) { - if (incoming->getAsyncIds().empty() && existing->getAsyncIds().empty()) { - current_clauses->pop_back(); - directive->getClausesInOriginalOrder()->pop_back(); - delete incoming; - break; - } - if (!incoming->getAsyncIds().empty() && - !existing->getAsyncIds().empty()) { - for (const auto &id : incoming->getAsyncIds()) { - bool found = false; - for (const auto &prev : existing->getAsyncIds()) { - if (prev == id) { - found = true; - break; - } - } - if (!found) { - existing->addAsyncId(id); + auto *incoming = static_cast(current_clause); + for (auto it = current_clauses->begin(); it != current_clauses->end() - 1; + ++it) { + auto *existing = static_cast(*it); + if (incoming->getDevnum().text == existing->getDevnum().text && + incoming->getQueues() == existing->getQueues()) { + const auto &incoming_ids = incoming->getAsyncIds(); + const auto &existing_ids = existing->getAsyncIds(); + if (incoming_ids.empty() && existing_ids.empty()) { + current_clauses->pop_back(); + directive->getClausesInOriginalOrder()->pop_back(); + delete incoming; + break; + } + if (!incoming_ids.empty() && !existing_ids.empty()) { + for (const auto &id : incoming_ids) { + bool found = false; + for (const auto &prev : existing_ids) { + if (prev.text == id.text) { + found = true; + break; } } - current_clauses->pop_back(); - directive->getClausesInOriginalOrder()->pop_back(); - delete incoming; - break; + if (!found) { + existing->addAsyncId(id); + } } + current_clauses->pop_back(); + directive->getClausesInOriginalOrder()->pop_back(); + delete incoming; + break; } } - }; + } +}; OpenACCClause *OpenACCWorkerClause::addClause(OpenACCDirective *directive) { @@ -1778,7 +1793,7 @@ void OpenACCWorkerClause::mergeClause(OpenACCDirective *directive, ++it) { auto *existing = static_cast(*it); if (existing->getModifier() == incoming->getModifier() && - existing->getNumExpr() == incoming->getNumExpr()) { + existing->getNumExpr().text == incoming->getNumExpr().text) { current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); delete incoming; diff --git a/src/OpenACCIR.h b/src/OpenACCIR.h index 8d281d5..b46ec9a 100644 --- a/src/OpenACCIR.h +++ b/src/OpenACCIR.h @@ -13,6 +13,11 @@ struct OpenACCExpressionItem { OpenACCClauseSeparator separator = ACCC_CLAUSE_SEP_comma; }; +struct OpenACCIdentifier { + std::string text; + bool is_string_literal = false; +}; + enum OpenACCBaseLang { ACC_Lang_C, ACC_Lang_Cplusplus, @@ -60,8 +65,7 @@ class OpenACCClause : public ACC_SourceLocation { * the expression/localtionLine/locationColumn are the same index are one * record for an expression and its location */ - std::vector expressions; - std::vector expression_separators; + std::vector expressions; std::vector locations; @@ -81,18 +85,22 @@ class OpenACCClause : public ACC_SourceLocation { // a list of expressions or variables that are language-specific for the // clause, accparser does not parse them, instead, it only stores them as // strings - void addLangExpr(std::string expression_string, + void addLangExpr(const OpenACCExpressionItem &expression, int line = 0, + int col = 0); + void addLangExpr(const std::string &expression_string, OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma, - int line = 0, int col = 0); - - std::vector *getExpressions() { return &expressions; }; - const std::vector &getExpressionSeparators() const { - return expression_separators; + int line = 0, int col = 0) { + addLangExpr(OpenACCExpressionItem{expression_string, sep}, line, col); } + std::vector *getExpressions() { return &expressions; }; + const std::vector *getExpressions() const { + return &expressions; + }; + virtual std::string toString(); virtual ~OpenACCClause() = default; - std::string expressionToString(); + std::string expressionToString() const; }; // Common base for clauses that carry a variable list. @@ -248,7 +256,7 @@ class OpenACCDirective : public ACC_SourceLocation { class OpenACCCacheDirective : public OpenACCDirective { protected: OpenACCCacheDirectiveModifier modifier = ACCC_CACHE_unspecified; - std::vector vars; + std::vector vars; public: OpenACCCacheDirective() : OpenACCDirective(ACCD_cache){}; @@ -256,19 +264,26 @@ class OpenACCCacheDirective : public OpenACCDirective { void setModifier(OpenACCCacheDirectiveModifier _modifier) { modifier = _modifier; }; - const std::vector &getVars() const { return vars; } - void addVar(const std::string &_string) { - if (std::find(vars.begin(), vars.end(), _string) == vars.end()) { - vars.push_back(_string); + const std::vector &getVars() const { return vars; } + void addVar(const std::string &_string, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + addVar(OpenACCExpressionItem{_string, sep}); + } + void addVar(const OpenACCExpressionItem &item) { + if (std::find_if(vars.begin(), vars.end(), + [&](const OpenACCExpressionItem &existing) { + return existing.text == item.text; + }) == vars.end()) { + vars.push_back(item); } }; std::string varsToString() const { std::string out; - for (auto it = vars.begin(); it != vars.end(); ++it) { - out += *it; - if (it + 1 != vars.end()) { - out += ", "; + for (size_t idx = 0; idx < vars.size(); ++idx) { + if (idx > 0) { + out += (vars[idx].separator == ACCC_CLAUSE_SEP_comma) ? ", " : " "; } + out += vars[idx].text; } return out; } @@ -291,34 +306,44 @@ class OpenACCEndDirective : public OpenACCDirective { // Routine directive class OpenACCRoutineDirective : public OpenACCDirective { protected: - std::string name = ""; - bool name_is_string_literal = false; + OpenACCIdentifier name; public: OpenACCRoutineDirective() : OpenACCDirective(ACCD_routine){}; void setName(std::string _name, bool is_string_literal = false) { - name = _name; - name_is_string_literal = is_string_literal; + name = {_name, is_string_literal}; }; - std::string getName() { return name; }; - bool isNameStringLiteral() const { return name_is_string_literal; }; + void setName(const OpenACCIdentifier &_name) { name = _name; }; + const OpenACCIdentifier &getName() const { return name; }; }; // Wait directive class OpenACCWaitDirective : public OpenACCDirective { protected: - std::vector async_ids; - std::string devnum = ""; + std::vector async_ids; + OpenACCExpressionItem devnum; bool queues = false; public: OpenACCWaitDirective() : OpenACCDirective(ACCD_wait){}; - void setDevnum(std::string _devnum) { devnum = _devnum; }; - std::string getDevnum() { return devnum; }; + void setDevnum(const OpenACCExpressionItem &_devnum) { devnum = _devnum; }; + void setDevnum(const std::string &_devnum, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + devnum = {_devnum, sep}; + }; + const OpenACCExpressionItem &getDevnum() const { return devnum; }; void setQueues(bool _queues) { queues = _queues; }; bool getQueues() { return queues; }; - std::vector *getAsyncIds() { return &async_ids; }; - void addAsyncId(std::string _string) { async_ids.push_back(_string); }; + const std::vector &getAsyncIds() const { + return async_ids; + }; + void addAsyncId(const OpenACCExpressionItem &_string) { + async_ids.push_back(_string); + }; + void addAsyncId(const std::string &_string, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + async_ids.push_back({_string, sep}); + }; std::string toString(); std::string expressionToString(); }; @@ -328,15 +353,19 @@ class OpenACCAsyncClause : public OpenACCClause { protected: OpenACCAsyncModifier modifier = ACCC_ASYNC_unspecified; - std::string async_expr; + OpenACCExpressionItem async_expr; public: OpenACCAsyncClause() : OpenACCClause(ACCC_async){}; void setModifier(OpenACCAsyncModifier m) { modifier = m; } OpenACCAsyncModifier getModifier() const { return modifier; } - void setAsyncExpr(const std::string &expr) { async_expr = expr; } - const std::string &getAsyncExpr() const { return async_expr; } + void setAsyncExpr(const OpenACCExpressionItem &expr) { async_expr = expr; } + void setAsyncExpr(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + async_expr = {expr, sep}; + } + const OpenACCExpressionItem &getAsyncExpr() const { return async_expr; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -347,18 +376,17 @@ class OpenACCAsyncClause : public OpenACCClause { class OpenACCBindClause : public OpenACCClause { protected: - std::string binding = ""; - bool is_string_literal = false; + OpenACCIdentifier binding; public: OpenACCBindClause() : OpenACCClause(ACCC_bind){}; void setBinding(const std::string &_binding, bool _is_string_literal) { - binding = _binding; - is_string_literal = _is_string_literal; + binding = {_binding, _is_string_literal}; } - const std::string &getBinding() const { return binding; } - bool isStringLiteral() const { return is_string_literal; } + void setBinding(const OpenACCIdentifier &_binding) { binding = _binding; } + const OpenACCIdentifier &getBinding() const { return binding; } + bool isStringLiteral() const { return binding.is_string_literal; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -369,13 +397,19 @@ class OpenACCBindClause : public OpenACCClause { class OpenACCCollapseClause : public OpenACCClause { protected: - std::vector counts; + std::vector counts; public: OpenACCCollapseClause() : OpenACCClause(ACCC_collapse){}; - void addCountExpr(const std::string &expr) { counts.push_back(expr); } - const std::vector &getCounts() const { return counts; } + void addCountExpr(const OpenACCExpressionItem &expr) { counts.push_back(expr); } + void addCountExpr(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + addCountExpr(OpenACCExpressionItem{expr, sep}); + } + const std::vector &getCounts() const { + return counts; + } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -537,13 +571,17 @@ class OpenACCDefaultClause : public OpenACCClause { class OpenACCDefaultAsyncClause : public OpenACCClause { protected: - std::string async_expr; + OpenACCExpressionItem async_expr; public: OpenACCDefaultAsyncClause() : OpenACCClause(ACCC_default_async){}; - void setAsyncExpr(const std::string &expr) { async_expr = expr; } - const std::string &getAsyncExpr() const { return async_expr; } + void setAsyncExpr(const OpenACCExpressionItem &expr) { async_expr = expr; } + void setAsyncExpr(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + async_expr = {expr, sep}; + } + const OpenACCExpressionItem &getAsyncExpr() const { return async_expr; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -584,17 +622,19 @@ class OpenACCDetachClause : public OpenACCVarListClause { class OpenACCDeviceClause : public OpenACCClause { protected: - std::vector devices; + std::vector devices; public: OpenACCDeviceClause() : OpenACCClause(ACCC_device) {} - void addDevice(const std::string &expr) { - if (std::find(devices.begin(), devices.end(), expr) == devices.end()) { - devices.push_back(expr); - } + void addDevice(const OpenACCExpressionItem &expr) { devices.push_back(expr); } + void addDevice(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + addDevice(OpenACCExpressionItem{expr, sep}); + } + const std::vector &getDevices() const { + return devices; } - const std::vector &getDevices() const { return devices; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -635,13 +675,17 @@ class OpenACCPrivateClause : public OpenACCVarListClause { class OpenACCIfClause : public OpenACCClause { protected: - std::string condition; + OpenACCExpressionItem condition; public: OpenACCIfClause() : OpenACCClause(ACCC_if) {} - void setCondition(const std::string &expr) { condition = expr; } - const std::string &getCondition() const { return condition; } + void setCondition(const OpenACCExpressionItem &expr) { condition = expr; } + void setCondition(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + condition = {expr, sep}; + } + const OpenACCExpressionItem &getCondition() const { return condition; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -654,7 +698,8 @@ class OpenACCGangClause : public OpenACCClause { public: struct GangArg { OpenACCGangArgKind kind; - std::string value; + OpenACCExpressionItem value; + OpenACCClauseSeparator separator = ACCC_CLAUSE_SEP_comma; }; protected: @@ -663,9 +708,13 @@ class OpenACCGangClause : public OpenACCClause { public: OpenACCGangClause() : OpenACCClause(ACCC_gang){}; - void addArg(OpenACCGangArgKind kind, const std::string &value) { + void addArg(OpenACCGangArgKind kind, const OpenACCExpressionItem &value) { args.push_back({kind, value}); } + void addArg(OpenACCGangArgKind kind, const std::string &value, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + addArg(kind, OpenACCExpressionItem{value, sep}); + } const std::vector &getArgs() const { return args; } static OpenACCClause *addClause(OpenACCDirective *); @@ -676,13 +725,17 @@ class OpenACCGangClause : public OpenACCClause { // Num_gangs Clause class OpenACCNumGangsClause : public OpenACCClause { protected: - std::vector nums; + std::vector nums; public: OpenACCNumGangsClause() : OpenACCClause(ACCC_num_gangs){}; - void addNum(const std::string &expr) { nums.push_back(expr); } - const std::vector &getNums() const { return nums; } + void addNum(const OpenACCExpressionItem &expr) { nums.push_back(expr); } + void addNum(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + nums.push_back(OpenACCExpressionItem{expr, sep}); + } + const std::vector &getNums() const { return nums; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -693,13 +746,17 @@ class OpenACCNumGangsClause : public OpenACCClause { class OpenACCNumWorkersClause : public OpenACCClause { protected: - std::string num_expr; + OpenACCExpressionItem num_expr; public: OpenACCNumWorkersClause() : OpenACCClause(ACCC_num_workers){}; - void setNumExpr(const std::string &expr) { num_expr = expr; } - const std::string &getNumExpr() const { return num_expr; } + void setNumExpr(const OpenACCExpressionItem &expr) { num_expr = expr; } + void setNumExpr(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + num_expr = {expr, sep}; + } + const OpenACCExpressionItem &getNumExpr() const { return num_expr; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -709,13 +766,17 @@ class OpenACCNumWorkersClause : public OpenACCClause { // Device_num Clause class OpenACCDeviceNumClause : public OpenACCClause { protected: - std::string device_expr; + OpenACCExpressionItem device_expr; public: OpenACCDeviceNumClause() : OpenACCClause(ACCC_device_num) {} - void setDeviceExpr(const std::string &expr) { device_expr = expr; } - const std::string &getDeviceExpr() const { return device_expr; } + void setDeviceExpr(const OpenACCExpressionItem &expr) { device_expr = expr; } + void setDeviceExpr(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + device_expr = {expr, sep}; + } + const OpenACCExpressionItem &getDeviceExpr() const { return device_expr; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -725,13 +786,21 @@ class OpenACCDeviceNumClause : public OpenACCClause { // Tile Clause class OpenACCTileClause : public OpenACCClause { protected: - std::vector tile_sizes; + std::vector tile_sizes; public: OpenACCTileClause() : OpenACCClause(ACCC_tile) {} - void addTileSize(const std::string &expr) { tile_sizes.push_back(expr); } - const std::vector &getTileSizes() const { return tile_sizes; } + void addTileSize(const OpenACCExpressionItem &expr) { + tile_sizes.push_back(expr); + } + void addTileSize(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + tile_sizes.push_back(OpenACCExpressionItem{expr, sep}); + } + const std::vector &getTileSizes() const { + return tile_sizes; + } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -763,13 +832,17 @@ class OpenACCReductionClause : public OpenACCVarListClause { class OpenACCSelfClause : public OpenACCVarListClause { protected: - std::string condition; + OpenACCExpressionItem condition; public: OpenACCSelfClause() : OpenACCVarListClause(ACCC_self) {} - void setCondition(const std::string &expr) { condition = expr; } - const std::string &getCondition() const { return condition; } + void setCondition(const OpenACCExpressionItem &expr) { condition = expr; } + void setCondition(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + condition = {expr, sep}; + } + const OpenACCExpressionItem &getCondition() const { return condition; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -780,7 +853,7 @@ class OpenACCSelfClause : public OpenACCVarListClause { class OpenACCVectorClause : public OpenACCClause { protected: OpenACCVectorClauseModifier modifier = ACCC_VECTOR_unspecified; - std::string length_expr; + OpenACCExpressionItem length_expr; public: OpenACCVectorClause() : OpenACCClause(ACCC_vector){}; @@ -790,8 +863,12 @@ class OpenACCVectorClause : public OpenACCClause { void setModifier(OpenACCVectorClauseModifier _modifier) { modifier = _modifier; }; - void setLengthExpr(const std::string &expr) { length_expr = expr; } - const std::string &getLengthExpr() const { return length_expr; } + void setLengthExpr(const OpenACCExpressionItem &expr) { length_expr = expr; } + void setLengthExpr(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + length_expr = {expr, sep}; + } + const OpenACCExpressionItem &getLengthExpr() const { return length_expr; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -802,13 +879,17 @@ class OpenACCVectorClause : public OpenACCClause { class OpenACCVectorLengthClause : public OpenACCClause { protected: - std::string length_expr; + OpenACCExpressionItem length_expr; public: OpenACCVectorLengthClause() : OpenACCClause(ACCC_vector_length){}; - void setLengthExpr(const std::string &expr) { length_expr = expr; } - const std::string &getLengthExpr() const { return length_expr; } + void setLengthExpr(const OpenACCExpressionItem &expr) { length_expr = expr; } + void setLengthExpr(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + length_expr = {expr, sep}; + } + const OpenACCExpressionItem &getLengthExpr() const { return length_expr; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -819,19 +900,27 @@ class OpenACCVectorLengthClause : public OpenACCClause { class OpenACCWaitClause : public OpenACCClause { protected: - std::string devnum = ""; + OpenACCExpressionItem devnum; bool queues = false; - std::vector async_ids; + std::vector async_ids; public: OpenACCWaitClause() : OpenACCClause(ACCC_wait){}; - void setDevnum(std::string _devnum) { devnum = _devnum; }; - std::string getDevnum() { return devnum; }; + void setDevnum(const OpenACCExpressionItem &_devnum) { devnum = _devnum; }; + void setDevnum(const std::string &_devnum, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + devnum = {_devnum, sep}; + }; + const OpenACCExpressionItem &getDevnum() const { return devnum; }; void setQueues(bool _queues) { queues = _queues; }; bool getQueues() { return queues; }; - void addAsyncId(const std::string &expr) { async_ids.push_back(expr); } - const std::vector &getAsyncIds() const { return async_ids; } + void addAsyncId(const OpenACCExpressionItem &expr) { async_ids.push_back(expr); } + void addAsyncId(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + async_ids.push_back(OpenACCExpressionItem{expr, sep}); + } + const std::vector &getAsyncIds() const { return async_ids; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); @@ -865,7 +954,7 @@ class OpenACCWorkerClause : public OpenACCClause { protected: OpenACCWorkerClauseModifier modifier = ACCC_WORKER_unspecified; - std::string num_expr; + OpenACCExpressionItem num_expr; public: OpenACCWorkerClause() : OpenACCClause(ACCC_worker){}; @@ -875,8 +964,12 @@ class OpenACCWorkerClause : public OpenACCClause { void setModifier(OpenACCWorkerClauseModifier _modifier) { modifier = _modifier; }; - void setNumExpr(const std::string &expr) { num_expr = expr; } - const std::string &getNumExpr() const { return num_expr; } + void setNumExpr(const OpenACCExpressionItem &expr) { num_expr = expr; } + void setNumExpr(const std::string &expr, + OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { + num_expr = {expr, sep}; + } + const OpenACCExpressionItem &getNumExpr() const { return num_expr; } static OpenACCClause *addClause(OpenACCDirective *); std::string toString(); diff --git a/src/OpenACCIRToString.cpp b/src/OpenACCIRToString.cpp index e62b8a2..b44538e 100644 --- a/src/OpenACCIRToString.cpp +++ b/src/OpenACCIRToString.cpp @@ -96,8 +96,9 @@ std::string OpenACCDirective::toString() { break; case ACCD_routine: result += "routine "; - if (!((OpenACCRoutineDirective *)this)->getName().empty()) { - result += "(" + ((OpenACCRoutineDirective *)this)->getName() + ") "; + if (!((OpenACCRoutineDirective *)this)->getName().text.empty()) { + result += + "(" + ((OpenACCRoutineDirective *)this)->getName().text + ") "; } break; case ACCD_serial: @@ -123,19 +124,17 @@ std::string OpenACCDirective::toString() { return result; }; -std::string OpenACCClause::expressionToString() { +std::string OpenACCClause::expressionToString() const { std::string result; - std::vector *expr = this->getExpressions(); + const auto *expr = this->getExpressions(); if (expr != NULL && !expr->empty()) { - const auto &seps = this->getExpressionSeparators(); for (size_t idx = 0; idx < expr->size(); ++idx) { if (idx > 0) { - OpenACCClauseSeparator sep = - (idx < seps.size()) ? seps[idx] : ACCC_CLAUSE_SEP_comma; - result += (sep == ACCC_CLAUSE_SEP_comma) ? ", " : " "; + result += ((*expr)[idx].separator == ACCC_CLAUSE_SEP_comma) ? ", " + : " "; } - result += (*expr)[idx]; + result += (*expr)[idx].text; } } @@ -365,7 +364,7 @@ std::string OpenACCCollapseClause::toString() { for (const auto &val : vals) { result += "collapse"; - result += "(" + val + ") "; + result += "(" + val.text + ") "; } return result; } @@ -373,8 +372,8 @@ std::string OpenACCCollapseClause::toString() { std::string OpenACCAsyncClause::toString() { std::string result = "async"; - if (getModifier() == ACCC_ASYNC_expr && !getAsyncExpr().empty()) { - result += "(" + getAsyncExpr() + ") "; + if (getModifier() == ACCC_ASYNC_expr && !getAsyncExpr().text.empty()) { + result += "(" + getAsyncExpr().text + ") "; } else { result += " "; } @@ -384,13 +383,13 @@ std::string OpenACCAsyncClause::toString() { std::string OpenACCWaitDirective::expressionToString() { std::string result; - std::vector *expr = this->getAsyncIds(); - if (expr != NULL && !expr->empty()) { - for (auto it = expr->begin(); it != expr->end(); ++it) { - if (it != expr->begin()) { - result += ", "; + const auto &expr = this->getAsyncIds(); + if (!expr.empty()) { + for (auto it = expr.begin(); it != expr.end(); ++it) { + if (it != expr.begin()) { + result += (it->separator == ACCC_CLAUSE_SEP_comma) ? ", " : " "; } - result += *it; + result += it->text; } } @@ -401,11 +400,11 @@ std::string OpenACCWaitDirective::toString() { std::string result = "wait"; std::string parameter_string = ""; - if (!this->getAsyncIds()->empty()) { + if (!this->getAsyncIds().empty()) { result += "("; - std::string devnum = this->getDevnum(); - if (devnum != "") { - parameter_string += "devnum: " + devnum + ": "; + const auto &devnum = this->getDevnum(); + if (!devnum.text.empty()) { + parameter_string += "devnum: " + devnum.text + ": "; }; if (this->getQueues() == true) { parameter_string += "queues: "; @@ -422,8 +421,8 @@ std::string OpenACCWaitDirective::toString() { std::string OpenACCDefaultAsyncClause::toString() { std::string result = "default_async"; - if (!getAsyncExpr().empty()) { - result += "(" + getAsyncExpr() + ") "; + if (!getAsyncExpr().text.empty()) { + result += "(" + getAsyncExpr().text + ") "; } else { result += " "; } @@ -437,9 +436,9 @@ std::string OpenACCDeviceClause::toString() { if (!devs.empty()) { result += "("; for (auto it = devs.begin(); it != devs.end(); ++it) { - result += *it; + result += it->text; if (it + 1 != devs.end()) { - result += ", "; + result += (it->separator == ACCC_CLAUSE_SEP_comma) ? ", " : " "; } } result += ") "; @@ -452,8 +451,8 @@ std::string OpenACCDeviceClause::toString() { std::string OpenACCIfClause::toString() { std::string result = "if"; - if (!getCondition().empty()) { - result += "(" + getCondition() + ") "; + if (!getCondition().text.empty()) { + result += "(" + getCondition().text + ") "; } else { result += " "; } @@ -463,8 +462,8 @@ std::string OpenACCIfClause::toString() { std::string OpenACCDeviceNumClause::toString() { std::string result = "device_num"; - if (!getDeviceExpr().empty()) { - result += "(" + getDeviceExpr() + ") "; + if (!getDeviceExpr().text.empty()) { + result += "(" + getDeviceExpr().text + ") "; } else { result += " "; } @@ -483,20 +482,21 @@ std::string OpenACCGangClause::toString() { const auto &arg_list = getArgs(); for (auto it = arg_list.begin(); it != arg_list.end(); ++it) { if (it != arg_list.begin()) { - parameter_string += ", "; + parameter_string += + (it->separator == ACCC_CLAUSE_SEP_comma) ? ", " : " "; } switch (it->kind) { case ACCC_GANG_ARG_num: - parameter_string += "num:" + it->value; + parameter_string += "num:" + it->value.text; break; case ACCC_GANG_ARG_dim: - parameter_string += "dim:" + it->value; + parameter_string += "dim:" + it->value.text; break; case ACCC_GANG_ARG_static: - parameter_string += "static:" + it->value; + parameter_string += "static:" + it->value.text; break; default: - parameter_string += it->value; + parameter_string += it->value.text; break; } } @@ -511,9 +511,9 @@ std::string OpenACCNumGangsClause::toString() { if (!vals.empty()) { result += "("; for (auto it = vals.begin(); it != vals.end(); ++it) { - result += *it; + result += it->text; if (it + 1 != vals.end()) - result += ", "; + result += (it->separator == ACCC_CLAUSE_SEP_comma) ? ", " : " "; } result += ") "; } else { @@ -525,8 +525,8 @@ std::string OpenACCNumGangsClause::toString() { std::string OpenACCNumWorkersClause::toString() { std::string result = "num_workers"; - if (!getNumExpr().empty()) { - result += "(" + getNumExpr() + ") "; + if (!getNumExpr().text.empty()) { + result += "(" + getNumExpr().text + ") "; } else { result += " "; } @@ -540,9 +540,9 @@ std::string OpenACCTileClause::toString() { if (!sizes.empty()) { result += "("; for (auto it = sizes.begin(); it != sizes.end(); ++it) { - result += *it; + result += it->text; if (it + 1 != sizes.end()) { - result += ", "; + result += (it->separator == ACCC_CLAUSE_SEP_comma) ? ", " : " "; } } result += ") "; @@ -555,8 +555,8 @@ std::string OpenACCTileClause::toString() { std::string OpenACCBindClause::toString() { std::string result = "bind"; - if (!getBinding().empty()) { - result += "(" + getBinding() + ") "; + if (!getBinding().text.empty()) { + result += "(" + getBinding().text + ") "; } else { result += " "; } @@ -739,8 +739,8 @@ std::string OpenACCDetachClause::toString() { std::string OpenACCSelfClause::toString() { std::string result = "self"; - if (!getCondition().empty()) { - result += "(" + getCondition() + ")"; + if (!getCondition().text.empty()) { + result += "(" + getCondition().text + ")"; } else if (!getVars().empty()) { result += "(" + varsToString() + ")"; } @@ -857,17 +857,17 @@ std::string OpenACCReductionClause::toString() { std::string OpenACCVectorClause::toString() { std::string result = "vector"; - const std::string &length = this->getLengthExpr(); + const auto &length = this->getLengthExpr(); switch (this->getModifier()) { case ACCC_VECTOR_length: - result += "(length: " + length + ") "; + result += "(length: " + length.text + ") "; break; case ACCC_VECTOR_expr_only: - result += "(" + length + ") "; + result += "(" + length.text + ") "; break; default: - if (!length.empty()) { - result += "(" + length + ") "; + if (!length.text.empty()) { + result += "(" + length.text + ") "; } else { result += " "; } @@ -879,9 +879,9 @@ std::string OpenACCVectorClause::toString() { std::string OpenACCVectorLengthClause::toString() { std::string result = "vector_length"; - const std::string &length = this->getLengthExpr(); - if (!length.empty()) { - result += "(" + length + ") "; + const auto &length = this->getLengthExpr(); + if (!length.text.empty()) { + result += "(" + length.text + ") "; } else { result += " "; } @@ -894,9 +894,9 @@ std::string OpenACCWaitClause::toString() { std::string parameter_string = ""; if (!this->getAsyncIds().empty()) { result += "("; - std::string devnum = this->getDevnum(); - if (devnum != "") { - parameter_string += "devnum: " + devnum + ": "; + const auto &devnum = this->getDevnum(); + if (!devnum.text.empty()) { + parameter_string += "devnum: " + devnum.text + ": "; }; if (this->getQueues() == true) { parameter_string += "queues: "; @@ -904,9 +904,10 @@ std::string OpenACCWaitClause::toString() { const auto &ids = this->getAsyncIds(); for (auto it = ids.begin(); it != ids.end(); ++it) { - parameter_string += *it; + parameter_string += it->text; if (it + 1 != ids.end()) { - parameter_string += ", "; + parameter_string += + (it->separator == ACCC_CLAUSE_SEP_comma) ? ", " : " "; } } result += parameter_string + ") "; @@ -920,17 +921,17 @@ std::string OpenACCWaitClause::toString() { std::string OpenACCWorkerClause::toString() { std::string result = "worker"; - const std::string &num = this->getNumExpr(); + const auto &num = this->getNumExpr(); switch (this->getModifier()) { case ACCC_WORKER_num: - result += "(num: " + num + ") "; + result += "(num: " + num.text + ") "; break; case ACCC_WORKER_expr_only: - result += "(" + num + ") "; + result += "(" + num.text + ") "; break; default: - if (!num.empty()) { - result += "(" + num + ") "; + if (!num.text.empty()) { + result += "(" + num.text + ") "; } else { result += " "; } From 1e482bb39c81357a9a5d3e9f8c655e4ee2d7f8c2 Mon Sep 17 00:00:00 2001 From: Anjia Wang Date: Mon, 24 Nov 2025 05:03:44 +0000 Subject: [PATCH 3/6] Wire parser actions to structured clause payloads --- src/OpenACCASTConstructor.cpp | 49 ++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/src/OpenACCASTConstructor.cpp b/src/OpenACCASTConstructor.cpp index bfc7a98..b4ad566 100644 --- a/src/OpenACCASTConstructor.cpp +++ b/src/OpenACCASTConstructor.cpp @@ -192,7 +192,7 @@ void OpenACCIRConstructor::enterAsync_clause( if (ctx->int_expr()) { std::string expr = trimEnclosingWhiteSpace(ctx->int_expr()->getText()); static_cast(current_clause) - ->setAsyncExpr(expr); + ->setAsyncExpr(OpenACCExpressionItem{expr, ACCC_CLAUSE_SEP_comma}); static_cast(current_clause) ->setModifier(ACCC_ASYNC_expr); } else { @@ -383,7 +383,7 @@ void OpenACCIRConstructor::exitDefault_async_clause( if (ctx->int_expr()) { std::string expr = trimEnclosingWhiteSpace(ctx->int_expr()->getText()); static_cast(current_clause) - ->setAsyncExpr(expr); + ->setAsyncExpr(OpenACCExpressionItem{expr, ACCC_CLAUSE_SEP_comma}); } ((OpenACCDefaultAsyncClause *)current_clause) ->mergeClause(current_directive, current_clause); @@ -680,7 +680,8 @@ void OpenACCIRConstructor::exitVector_clause( if (ctx->vector_clause_args() && ctx->vector_clause_args()->int_expr()) { std::string expr = trimEnclosingWhiteSpace(ctx->vector_clause_args()->int_expr()->getText()); - ((OpenACCVectorClause *)current_clause)->setLengthExpr(expr); + ((OpenACCVectorClause *)current_clause) + ->setLengthExpr(OpenACCExpressionItem{expr, ACCC_CLAUSE_SEP_comma}); if (((OpenACCVectorClause *)current_clause)->getModifier() == ACCC_VECTOR_unspecified) { ((OpenACCVectorClause *)current_clause)->setModifier(ACCC_VECTOR_expr_only); @@ -700,7 +701,8 @@ void OpenACCIRConstructor::exitVector_length_clause( if (ctx->int_expr()) { std::string expr = trimEnclosingWhiteSpace(ctx->int_expr()->getText()); - ((OpenACCVectorLengthClause *)current_clause)->setLengthExpr(expr); + ((OpenACCVectorLengthClause *)current_clause) + ->setLengthExpr(OpenACCExpressionItem{expr, ACCC_CLAUSE_SEP_comma}); } ((OpenACCVectorLengthClause *)current_clause) ->mergeClause(current_directive, current_clause); @@ -739,9 +741,11 @@ void OpenACCIRConstructor::exitWait_argument_int_expr( accparser::Wait_argument_int_exprContext *ctx) { std::string expression = trimEnclosingWhiteSpace(ctx->getText()); if (current_directive->getKind() == ACCD_wait) { - ((OpenACCWaitDirective *)current_directive)->setDevnum(expression); + ((OpenACCWaitDirective *)current_directive) + ->setDevnum(OpenACCExpressionItem{expression, ACCC_CLAUSE_SEP_comma}); } else { - ((OpenACCWaitClause *)current_clause)->setDevnum(expression); + ((OpenACCWaitClause *)current_clause) + ->setDevnum(OpenACCExpressionItem{expression, ACCC_CLAUSE_SEP_comma}); } }; @@ -749,9 +753,11 @@ void OpenACCIRConstructor::exitWait_int_expr( accparser::Wait_int_exprContext *ctx) { std::string expression = trimEnclosingWhiteSpace(ctx->getText()); if (current_directive->getKind() == ACCD_wait) { - ((OpenACCWaitDirective *)current_directive)->addAsyncId(expression); + ((OpenACCWaitDirective *)current_directive) + ->addAsyncId(OpenACCExpressionItem{expression, ACCC_CLAUSE_SEP_comma}); } else { - static_cast(current_clause)->addAsyncId(expression); + static_cast(current_clause) + ->addAsyncId(OpenACCExpressionItem{expression, ACCC_CLAUSE_SEP_comma}); } }; @@ -777,7 +783,8 @@ void OpenACCIRConstructor::exitWorker_clause( if (ctx->worker_clause_args() && ctx->worker_clause_args()->int_expr()) { std::string expr = trimEnclosingWhiteSpace(ctx->worker_clause_args()->int_expr()->getText()); - ((OpenACCWorkerClause *)current_clause)->setNumExpr(expr); + ((OpenACCWorkerClause *)current_clause) + ->setNumExpr(OpenACCExpressionItem{expr, ACCC_CLAUSE_SEP_comma}); if (((OpenACCWorkerClause *)current_clause)->getModifier() == ACCC_WORKER_unspecified) { ((OpenACCWorkerClause *)current_clause)->setModifier(ACCC_WORKER_expr_only); @@ -817,34 +824,40 @@ void OpenACCIRConstructor::exitInt_expr(accparser::Int_exprContext *ctx) { } if (kind == ACCC_wait) { static_cast(current_clause) - ->addAsyncId(trimEnclosingWhiteSpace(ctx->getText())); + ->addAsyncId(OpenACCExpressionItem{ + trimEnclosingWhiteSpace(ctx->getText()), ACCC_CLAUSE_SEP_comma}); return; } if (kind == ACCC_async) { static_cast(current_clause) - ->setAsyncExpr(trimEnclosingWhiteSpace(ctx->getText())); + ->setAsyncExpr(OpenACCExpressionItem{ + trimEnclosingWhiteSpace(ctx->getText()), ACCC_CLAUSE_SEP_comma}); static_cast(current_clause) ->setModifier(ACCC_ASYNC_expr); return; } if (kind == ACCC_default_async) { static_cast(current_clause) - ->setAsyncExpr(trimEnclosingWhiteSpace(ctx->getText())); + ->setAsyncExpr(OpenACCExpressionItem{ + trimEnclosingWhiteSpace(ctx->getText()), ACCC_CLAUSE_SEP_comma}); return; } if (kind == ACCC_device_num) { static_cast(current_clause) - ->setDeviceExpr(trimEnclosingWhiteSpace(ctx->getText())); + ->setDeviceExpr(OpenACCExpressionItem{ + trimEnclosingWhiteSpace(ctx->getText()), ACCC_CLAUSE_SEP_comma}); return; } if (kind == ACCC_num_workers) { static_cast(current_clause) - ->setNumExpr(trimEnclosingWhiteSpace(ctx->getText())); + ->setNumExpr(OpenACCExpressionItem{ + trimEnclosingWhiteSpace(ctx->getText()), ACCC_CLAUSE_SEP_comma}); return; } if (kind == ACCC_num_gangs) { static_cast(current_clause) - ->addNum(trimEnclosingWhiteSpace(ctx->getText())); + ->addNum(OpenACCExpressionItem{ + trimEnclosingWhiteSpace(ctx->getText()), ACCC_CLAUSE_SEP_comma}); return; } if (kind == ACCC_collapse) { @@ -895,11 +908,11 @@ void OpenACCIRConstructor::exitVar(accparser::VarContext *ctx) { if (current_clause->getKind() == ACCC_gang) { auto *gang = static_cast(current_clause); OpenACCGangArgKind kind = ACCC_GANG_ARG_other; - std::string value = expression; + OpenACCExpressionItem value{expression, ACCC_CLAUSE_SEP_comma}; size_t colon = expression.find(':'); if (colon != std::string::npos) { std::string key = trimEnclosingWhiteSpace(expression.substr(0, colon)); - value = trimEnclosingWhiteSpace(expression.substr(colon + 1)); + value.text = trimEnclosingWhiteSpace(expression.substr(colon + 1)); std::transform(key.begin(), key.end(), key.begin(), ::tolower); if (key == "num") { kind = ACCC_GANG_ARG_num; @@ -909,7 +922,7 @@ void OpenACCIRConstructor::exitVar(accparser::VarContext *ctx) { kind = ACCC_GANG_ARG_static; } else { kind = ACCC_GANG_ARG_other; - value = expression; + value.text = expression; } } gang->addArg(kind, value); From a496ea6b690fa83a166e336208a27b08a8f3695a Mon Sep 17 00:00:00 2001 From: Anjia Wang Date: Mon, 24 Nov 2025 05:37:49 +0000 Subject: [PATCH 4/6] Restore built-in normalized outputs with clause merging enabled --- tests/acc_tester.cpp | 5 ++ tests/builtin/reference/ref_data.txt | 18 ++--- tests/builtin/reference/ref_data_fortran.txt | 18 ++--- tests/builtin/reference/ref_declare.txt | 6 +- .../builtin/reference/ref_declare_fortran.txt | 6 +- tests/builtin/reference/ref_enter_data.txt | 12 ++-- .../reference/ref_enter_data_fortran.txt | 12 ++-- tests/builtin/reference/ref_exit_data.txt | 10 +-- .../reference/ref_exit_data_fortran.txt | 10 +-- tests/builtin/reference/ref_host_data.txt | 2 +- .../reference/ref_host_data_fortran.txt | 2 +- tests/builtin/reference/ref_kernels.txt | 34 +++++----- .../builtin/reference/ref_kernels_fortran.txt | 34 +++++----- tests/builtin/reference/ref_kernels_loop.txt | 66 +++++++++---------- .../reference/ref_kernels_loop_fortran.txt | 66 +++++++++---------- tests/builtin/reference/ref_loop.txt | 32 ++++----- tests/builtin/reference/ref_loop_fortran.txt | 32 ++++----- tests/builtin/reference/ref_parallel.txt | 42 ++++++------ .../reference/ref_parallel_fortran.txt | 42 ++++++------ tests/builtin/reference/ref_parallel_loop.txt | 66 +++++++++---------- .../reference/ref_parallel_loop_fortran.txt | 66 +++++++++---------- tests/builtin/reference/ref_routine.txt | 2 +- .../builtin/reference/ref_routine_fortran.txt | 2 +- tests/builtin/reference/ref_serial.txt | 34 +++++----- .../builtin/reference/ref_serial_fortran.txt | 34 +++++----- tests/builtin/reference/ref_serial_loop.txt | 58 ++++++++-------- .../reference/ref_serial_loop_fortran.txt | 58 ++++++++-------- tests/builtin/reference/ref_set.txt | 4 +- tests/builtin/reference/ref_set_fortran.txt | 4 +- tests/builtin/reference/ref_update.txt | 22 +++---- .../builtin/reference/ref_update_fortran.txt | 22 +++---- 31 files changed, 413 insertions(+), 408 deletions(-) diff --git a/tests/acc_tester.cpp b/tests/acc_tester.cpp index 094c848..44b74c7 100644 --- a/tests/acc_tester.cpp +++ b/tests/acc_tester.cpp @@ -40,6 +40,11 @@ int main(int argc, char **argv) { const char *filename = NULL; int result = 0; + + // Built-in tests expect normalized/merged clause output; enable merging here + // while keeping the round-trip tool (acc_roundtrip) in non-merging mode. + OpenACCDirective::setClauseMerging(true); + if (argc > 1) { filename = argv[1]; }; diff --git a/tests/builtin/reference/ref_data.txt b/tests/builtin/reference/ref_data.txt index fcbeacc..13d2a8d 100644 --- a/tests/builtin/reference/ref_data.txt +++ b/tests/builtin/reference/ref_data.txt @@ -18,19 +18,19 @@ #pragma acc data if(x==3) #pragma acc data no_create(a, b, c) #pragma acc data present(a, b, c) -#pragma acc data copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -#pragma acc data copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +#pragma acc data copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc data copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc data copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc data copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc data copyin(x, y, z) copyin(a, b, c) -#pragma acc data copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -#pragma acc data copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +#pragma acc data copyin(x, y, z, a, b, c) +#pragma acc data copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc data copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc data copyout(x, y, z) copyout(zero: a, b, c) #pragma acc data copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc data copyout(x, y, z) copyout(a, b, c) -#pragma acc data create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -#pragma acc data create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +#pragma acc data copyout(x, y, z, a, b, c) +#pragma acc data create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc data create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc data create(x, y, z) create(zero: a, b, c) #pragma acc data create(zero: x, y, z) create(a, b, c) -#pragma acc data create(x, y, z) create(a, b, c) +#pragma acc data create(x, y, z, a, b, c) #pragma acc data copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) diff --git a/tests/builtin/reference/ref_data_fortran.txt b/tests/builtin/reference/ref_data_fortran.txt index a706770..1a64fd1 100644 --- a/tests/builtin/reference/ref_data_fortran.txt +++ b/tests/builtin/reference/ref_data_fortran.txt @@ -18,20 +18,20 @@ !$acc data if(x==3) !$acc data no_create(a, b, c) !$acc data present(a, b, c) -!$acc data copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -!$acc data copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +!$acc data copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc data copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc data copyin(x, y, z) copyin(readonly: a, b, c) !$acc data copyin(readonly: x, y, z) copyin(a, b, c) -!$acc data copyin(x, y, z) copyin(a, b, c) -!$acc data copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -!$acc data copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +!$acc data copyin(x, y, z, a, b, c) +!$acc data copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc data copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc data copyout(x, y, z) copyout(zero: a, b, c) !$acc data copyout(zero: x, y, z) copyout(a, b, c) -!$acc data copyout(x, y, z) copyout(a, b, c) -!$acc data create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -!$acc data create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +!$acc data copyout(x, y, z, a, b, c) +!$acc data create(zero: x, y, z, x, y, a, a, b, c) +!$acc data create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc data create(x, y, z) create(zero: a, b, c) !$acc data create(zero: x, y, z) create(a, b, c) -!$acc data create(x, y, z) create(a, b, c) +!$acc data create(x, y, z, a, b, c) !$acc data copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) !$acc end data diff --git a/tests/builtin/reference/ref_declare.txt b/tests/builtin/reference/ref_declare.txt index 90e16d2..fb34ea8 100644 --- a/tests/builtin/reference/ref_declare.txt +++ b/tests/builtin/reference/ref_declare.txt @@ -3,11 +3,11 @@ #pragma acc declare copyin(readonly: m, n) #pragma acc declare copyin(readonly: m, n, readonly) #pragma acc declare copyin(readonly: readonly::m, n, readonly) -#pragma acc declare copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -#pragma acc declare copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +#pragma acc declare copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc declare copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc declare copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc declare copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc declare copyin(x, y, z) copyin(a, b, c) +#pragma acc declare copyin(x, y, z, a, b, c) #pragma acc declare copyout(12, 23, 34) #pragma acc declare create(12, 23, 34) #pragma acc declare present(a, b, c) diff --git a/tests/builtin/reference/ref_declare_fortran.txt b/tests/builtin/reference/ref_declare_fortran.txt index e772146..bcaa591 100644 --- a/tests/builtin/reference/ref_declare_fortran.txt +++ b/tests/builtin/reference/ref_declare_fortran.txt @@ -3,11 +3,11 @@ !$acc declare copyin(readonly: m, n) !$acc declare copyin(readonly: m, n, readonly) !$acc declare copyin(readonly: readonly::m, n, readonly) -!$acc declare copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -!$acc declare copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +!$acc declare copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc declare copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc declare copyin(x, y, z) copyin(readonly: a, b, c) !$acc declare copyin(readonly: x, y, z) copyin(a, b, c) -!$acc declare copyin(x, y, z) copyin(a, b, c) +!$acc declare copyin(x, y, z, a, b, c) !$acc declare copyout(12, 23, 34) !$acc declare create(12, 23, 34) !$acc declare present(a, b, c) diff --git a/tests/builtin/reference/ref_enter_data.txt b/tests/builtin/reference/ref_enter_data.txt index 720f142..2552a55 100644 --- a/tests/builtin/reference/ref_enter_data.txt +++ b/tests/builtin/reference/ref_enter_data.txt @@ -1,22 +1,22 @@ #pragma acc enter data async(5) #pragma acc enter data attach(a, b, c) #pragma acc enter data copyin(x, y) -#pragma acc enter data copyin(x, y, z) copyin(a, b, c) +#pragma acc enter data copyin(x, y, z, a, b, c) #pragma acc enter data create(12, 23, 34) #pragma acc enter data create(zero: 12, 23, 34) #pragma acc enter data create(zero: 12, 23, 34, zero) #pragma acc enter data create(zero: zero::12, 23, 34) #pragma acc enter data if(5) #pragma acc enter data if(x==3) -#pragma acc enter data create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -#pragma acc enter data create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +#pragma acc enter data create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc enter data create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc enter data create(x, y, z) create(zero: a, b, c) #pragma acc enter data create(zero: x, y, z) create(a, b, c) -#pragma acc enter data create(x, y, z) create(a, b, c) +#pragma acc enter data create(x, y, z, a, b, c) #pragma acc enter data async(expression1) async(expression2) async(expression3) -#pragma acc enter data async(expression1) async(expression2) async(expression1) +#pragma acc enter data async(expression1) async(expression2) #pragma acc enter data async(expression1) async -#pragma acc enter data async async(expression1) async +#pragma acc enter data async async(expression1) #pragma acc enter data wait(queues::a, devnum::b, devnum::queues::c) #pragma acc enter data wait(queues: 12, 23, 34) #pragma acc enter data wait(devnum: 12: queues: 23, 34) diff --git a/tests/builtin/reference/ref_enter_data_fortran.txt b/tests/builtin/reference/ref_enter_data_fortran.txt index 9af5d9b..11e926f 100644 --- a/tests/builtin/reference/ref_enter_data_fortran.txt +++ b/tests/builtin/reference/ref_enter_data_fortran.txt @@ -1,22 +1,22 @@ !$acc enter data async(5) !$acc enter data attach(a, b, c) !$acc enter data copyin(x, y) -!$acc enter data copyin(x, y, z) copyin(a, b, c) +!$acc enter data copyin(x, y, z, a, b, c) !$acc enter data create(12, 23, 34) !$acc enter data create(zero: 12, 23, 34) !$acc enter data create(zero: 12, 23, 34, zero) !$acc enter data create(zero: zero::12, 23, 34) !$acc enter data if(5) !$acc enter data if(x==3) -!$acc enter data create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -!$acc enter data create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +!$acc enter data create(zero: x, y, z, x, y, a, a, b, c) +!$acc enter data create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc enter data create(x, y, z) create(zero: a, b, c) !$acc enter data create(zero: x, y, z) create(a, b, c) -!$acc enter data create(x, y, z) create(a, b, c) +!$acc enter data create(x, y, z, a, b, c) !$acc enter data async(expression1) async(expression2) async(expression3) -!$acc enter data async(expression1) async(expression2) async(expression1) +!$acc enter data async(expression1) async(expression2) !$acc enter data async(expression1) async -!$acc enter data async async(expression1) async +!$acc enter data async async(expression1) !$acc enter data wait(queues::a, devnum::b, devnum::queues::c) !$acc enter data wait(queues: 12, 23, 34) !$acc enter data wait(devnum: 12: queues: 23, 34) diff --git a/tests/builtin/reference/ref_exit_data.txt b/tests/builtin/reference/ref_exit_data.txt index e64fcee..695cb40 100644 --- a/tests/builtin/reference/ref_exit_data.txt +++ b/tests/builtin/reference/ref_exit_data.txt @@ -1,17 +1,17 @@ #pragma acc exit data async(5) #pragma acc exit data copyout(x, y) -#pragma acc exit data copyout(x, y, z) copyout(a, b, c) +#pragma acc exit data copyout(x, y, z, a, b, c) #pragma acc exit data wait(12, 23, 34) #pragma acc exit data if(5) #pragma acc exit data if(x==3) #pragma acc exit data async(expression1) async(expression2) async(expression3) -#pragma acc exit data async(expression1) async(expression2) async(expression1) +#pragma acc exit data async(expression1) async(expression2) #pragma acc exit data async(expression1) async -#pragma acc exit data async async(expression1) async +#pragma acc exit data async async(expression1) #pragma acc exit data delete(x, y) -#pragma acc exit data delete(x, y, z) delete(a, b, c) +#pragma acc exit data delete(x, y, z, a, b, c) #pragma acc exit data detach(x, y) -#pragma acc exit data detach(x, y, z) detach(a, b, c) +#pragma acc exit data detach(x, y, z, a, b, c) #pragma acc exit data finalize #pragma acc exit data wait(queues::a, devnum::b, devnum::queues::c) #pragma acc exit data wait(queues: 12, 23, 34) diff --git a/tests/builtin/reference/ref_exit_data_fortran.txt b/tests/builtin/reference/ref_exit_data_fortran.txt index 9f52f28..e2b920f 100644 --- a/tests/builtin/reference/ref_exit_data_fortran.txt +++ b/tests/builtin/reference/ref_exit_data_fortran.txt @@ -1,17 +1,17 @@ !$acc exit data async(5) !$acc exit data copyout(x, y) -!$acc exit data copyout(x, y, z) copyout(a, b, c) +!$acc exit data copyout(x, y, z, a, b, c) !$acc exit data wait(12, 23, 34) !$acc exit data if(5) !$acc exit data if(x==3) !$acc exit data async(expression1) async(expression2) async(expression3) -!$acc exit data async(expression1) async(expression2) async(expression1) +!$acc exit data async(expression1) async(expression2) !$acc exit data async(expression1) async -!$acc exit data async async(expression1) async +!$acc exit data async async(expression1) !$acc exit data delete(x, y) -!$acc exit data delete(x, y, z) delete(a, b, c) +!$acc exit data delete(x, y, z, a, b, c) !$acc exit data detach(x, y) -!$acc exit data detach(x, y, z) detach(a, b, c) +!$acc exit data detach(x, y, z, a, b, c) !$acc exit data finalize !$acc exit data wait(queues::a, devnum::b, devnum::queues::c) !$acc exit data wait(queues: 12, 23, 34) diff --git a/tests/builtin/reference/ref_host_data.txt b/tests/builtin/reference/ref_host_data.txt index 3e02d1d..4f3df27 100644 --- a/tests/builtin/reference/ref_host_data.txt +++ b/tests/builtin/reference/ref_host_data.txt @@ -3,4 +3,4 @@ #pragma acc host_data if(5) if_present #pragma acc host_data use_device(a, b, c) #pragma acc host_data use_device(a, b, c) if(5) if_present -#pragma acc host_data use_device(a, b, c) use_device(a, b, c, d) if(5) if_present if_present +#pragma acc host_data use_device(a, b, c, a, b, c, d) if(5) if_present diff --git a/tests/builtin/reference/ref_host_data_fortran.txt b/tests/builtin/reference/ref_host_data_fortran.txt index b0b826d..34424c8 100644 --- a/tests/builtin/reference/ref_host_data_fortran.txt +++ b/tests/builtin/reference/ref_host_data_fortran.txt @@ -4,5 +4,5 @@ !$acc host_data if(5) if_present !$acc host_data use_device(a, b, c) !$acc host_data use_device(a, b, c) if(5) if_present -!$acc host_data use_device(a, b, c) use_device(a, b, c, d) if(5) if_present if_present +!$acc host_data use_device(a, b, c, a, b, c, d) if(5) if_present !$acc end host_data diff --git a/tests/builtin/reference/ref_kernels.txt b/tests/builtin/reference/ref_kernels.txt index cd1ff18..1d24460 100644 --- a/tests/builtin/reference/ref_kernels.txt +++ b/tests/builtin/reference/ref_kernels.txt @@ -25,33 +25,33 @@ #pragma acc kernels self(5) #pragma acc kernels self(x==3) #pragma acc kernels device_type(x, y, z) -#pragma acc kernels copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -#pragma acc kernels copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +#pragma acc kernels copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc kernels copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc kernels copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc kernels copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc kernels copyin(x, y, z) copyin(a, b, c) -#pragma acc kernels copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -#pragma acc kernels copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +#pragma acc kernels copyin(x, y, z, a, b, c) +#pragma acc kernels copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc kernels copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc kernels copyout(x, y, z) copyout(zero: a, b, c) #pragma acc kernels copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc kernels copyout(x, y, z) copyout(a, b, c) -#pragma acc kernels create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -#pragma acc kernels create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +#pragma acc kernels copyout(x, y, z, a, b, c) +#pragma acc kernels create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc kernels create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc kernels create(x, y, z) create(zero: a, b, c) #pragma acc kernels create(zero: x, y, z) create(a, b, c) -#pragma acc kernels create(x, y, z) create(a, b, c) +#pragma acc kernels create(x, y, z, a, b, c) #pragma acc kernels async(expression1) async(expression2) async(expression3) -#pragma acc kernels async(expression1) async(expression2) async(expression1) +#pragma acc kernels async(expression1) async(expression2) #pragma acc kernels async(expression1) async -#pragma acc kernels async async(expression1) async +#pragma acc kernels async async(expression1) #pragma acc kernels num_workers(expression1) num_workers(expression2) num_workers(expression3) -#pragma acc kernels num_workers(expression1) num_workers(expression2) num_workers(expression1) +#pragma acc kernels num_workers(expression1) num_workers(expression2) #pragma acc kernels vector_length(expression1) vector_length(expression2) vector_length(expression3) -#pragma acc kernels vector_length(expression1) vector_length(expression2) vector_length(expression1) +#pragma acc kernels vector_length(expression1) vector_length(expression2) #pragma acc kernels self(expression1) self(expression2) self(expression3) -#pragma acc kernels self(expression1) self(expression2) self(expression1) +#pragma acc kernels self(expression1) self(expression2) #pragma acc kernels self(expression1) self -#pragma acc kernels self self(expression1) self +#pragma acc kernels self self(expression1) #pragma acc kernels num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -#pragma acc kernels num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) -#pragma acc kernels wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) +#pragma acc kernels num_gangs(expression1) num_gangs(expression2) +#pragma acc kernels wait wait(a, b, c, d) diff --git a/tests/builtin/reference/ref_kernels_fortran.txt b/tests/builtin/reference/ref_kernels_fortran.txt index 6cb538f..dfb088a 100644 --- a/tests/builtin/reference/ref_kernels_fortran.txt +++ b/tests/builtin/reference/ref_kernels_fortran.txt @@ -25,34 +25,34 @@ !$acc kernels self(5) !$acc kernels self(x==3) !$acc kernels device_type(x, y, z) -!$acc kernels copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -!$acc kernels copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +!$acc kernels copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc kernels copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc kernels copyin(x, y, z) copyin(readonly: a, b, c) !$acc kernels copyin(readonly: x, y, z) copyin(a, b, c) -!$acc kernels copyin(x, y, z) copyin(a, b, c) -!$acc kernels copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -!$acc kernels copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +!$acc kernels copyin(x, y, z, a, b, c) +!$acc kernels copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc kernels copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc kernels copyout(x, y, z) copyout(zero: a, b, c) !$acc kernels copyout(zero: x, y, z) copyout(a, b, c) -!$acc kernels copyout(x, y, z) copyout(a, b, c) -!$acc kernels create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -!$acc kernels create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +!$acc kernels copyout(x, y, z, a, b, c) +!$acc kernels create(zero: x, y, z, x, y, a, a, b, c) +!$acc kernels create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc kernels create(x, y, z) create(zero: a, b, c) !$acc kernels create(zero: x, y, z) create(a, b, c) -!$acc kernels create(x, y, z) create(a, b, c) +!$acc kernels create(x, y, z, a, b, c) !$acc kernels async(expression1) async(expression2) async(expression3) -!$acc kernels async(expression1) async(expression2) async(expression1) +!$acc kernels async(expression1) async(expression2) !$acc kernels async(expression1) async -!$acc kernels async async(expression1) async +!$acc kernels async async(expression1) !$acc kernels num_workers(expression1) num_workers(expression2) num_workers(expression3) -!$acc kernels num_workers(expression1) num_workers(expression2) num_workers(expression1) +!$acc kernels num_workers(expression1) num_workers(expression2) !$acc kernels vector_length(expression1) vector_length(expression2) vector_length(expression3) -!$acc kernels vector_length(expression1) vector_length(expression2) vector_length(expression1) +!$acc kernels vector_length(expression1) vector_length(expression2) !$acc kernels self(expression1) self(expression2) self(expression3) -!$acc kernels self(expression1) self(expression2) self(expression1) +!$acc kernels self(expression1) self(expression2) !$acc kernels self(expression1) self -!$acc kernels self self(expression1) self +!$acc kernels self self(expression1) !$acc kernels num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -!$acc kernels num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) -!$acc kernels wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) +!$acc kernels num_gangs(expression1) num_gangs(expression2) +!$acc kernels wait wait(a, b, c, d) !$acc end kernels diff --git a/tests/builtin/reference/ref_kernels_loop.txt b/tests/builtin/reference/ref_kernels_loop.txt index 65e182b..d9ffb09 100644 --- a/tests/builtin/reference/ref_kernels_loop.txt +++ b/tests/builtin/reference/ref_kernels_loop.txt @@ -25,76 +25,76 @@ #pragma acc kernels loop self(5) #pragma acc kernels loop self(x==3) #pragma acc kernels loop device_type(x, y, z) -#pragma acc kernels loop copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -#pragma acc kernels loop copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +#pragma acc kernels loop copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc kernels loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc kernels loop copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc kernels loop copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc kernels loop copyin(x, y, z) copyin(a, b, c) -#pragma acc kernels loop copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -#pragma acc kernels loop copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +#pragma acc kernels loop copyin(x, y, z, a, b, c) +#pragma acc kernels loop copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc kernels loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc kernels loop copyout(x, y, z) copyout(zero: a, b, c) #pragma acc kernels loop copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc kernels loop copyout(x, y, z) copyout(a, b, c) -#pragma acc kernels loop create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -#pragma acc kernels loop create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +#pragma acc kernels loop copyout(x, y, z, a, b, c) +#pragma acc kernels loop create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc kernels loop create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc kernels loop create(x, y, z) create(zero: a, b, c) #pragma acc kernels loop create(zero: x, y, z) create(a, b, c) -#pragma acc kernels loop create(x, y, z) create(a, b, c) +#pragma acc kernels loop create(x, y, z, a, b, c) #pragma acc kernels loop async(expression1) async(expression2) async(expression3) -#pragma acc kernels loop async(expression1) async(expression2) async(expression1) +#pragma acc kernels loop async(expression1) async(expression2) #pragma acc kernels loop async(expression1) async -#pragma acc kernels loop async async(expression1) async +#pragma acc kernels loop async async(expression1) #pragma acc kernels loop num_workers(expression1) num_workers(expression2) num_workers(expression3) -#pragma acc kernels loop num_workers(expression1) num_workers(expression2) num_workers(expression1) +#pragma acc kernels loop num_workers(expression1) num_workers(expression2) #pragma acc kernels loop vector_length(expression1) vector_length(expression2) vector_length(expression3) -#pragma acc kernels loop vector_length(expression1) vector_length(expression2) vector_length(expression1) +#pragma acc kernels loop vector_length(expression1) vector_length(expression2) #pragma acc kernels loop self(expression1) self(expression2) self(expression3) -#pragma acc kernels loop self(expression1) self(expression2) self(expression1) +#pragma acc kernels loop self(expression1) self(expression2) #pragma acc kernels loop self(expression1) self -#pragma acc kernels loop self self(expression1) self +#pragma acc kernels loop self self(expression1) #pragma acc kernels loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -#pragma acc kernels loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) -#pragma acc kernels loop wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) +#pragma acc kernels loop num_gangs(expression1) num_gangs(expression2) +#pragma acc kernels loop wait wait(a, b, c, d) #pragma acc kernels loop #pragma acc kernels loop private(a, b, c) #pragma acc kernels loop auto -#pragma acc kernels loop auto auto +#pragma acc kernels loop auto #pragma acc kernels loop collapse(1) #pragma acc kernels loop collapse(1) collapse(2) -#pragma acc kernels loop collapse(1) collapse(1) collapse(2) +#pragma acc kernels loop collapse(1) collapse(2) #pragma acc kernels loop device_type(a, b, c) #pragma acc kernels loop gang #pragma acc kernels loop gang(a, b, c) -#pragma acc kernels loop gang(a, b, c) gang(c) gang(d) +#pragma acc kernels loop gang(a, b, c, d) #pragma acc kernels loop gang(a, b, c) gang -#pragma acc kernels loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) +#pragma acc kernels loop gang gang(a, b, c, d) +#pragma acc kernels loop independent #pragma acc kernels loop independent -#pragma acc kernels loop independent independent #pragma acc kernels loop seq #pragma acc kernels loop vector(length: a) #pragma acc kernels loop vector(length: a) vector(length: b) -#pragma acc kernels loop vector(length: a) vector(length: a) +#pragma acc kernels loop vector(length: a) #pragma acc kernels loop vector(c) vector(length: c) #pragma acc kernels loop vector(c) vector(b) -#pragma acc kernels loop vector(c) vector(c) +#pragma acc kernels loop vector(c) #pragma acc kernels loop worker(num: a) #pragma acc kernels loop worker(num: a) worker(num: b) -#pragma acc kernels loop worker(num: a) worker(num: a) +#pragma acc kernels loop worker(num: a) #pragma acc kernels loop worker(c) worker(num: c) #pragma acc kernels loop worker(c) worker(b) -#pragma acc kernels loop worker(c) worker(c) +#pragma acc kernels loop worker(c) #pragma acc kernels loop tile(1) -#pragma acc kernels loop tile(1) tile(2) -#pragma acc kernels loop tile(1) tile(1) tile(2) -#pragma acc kernels loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) -#pragma acc kernels loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) +#pragma acc kernels loop tile(1, 2) +#pragma acc kernels loop tile(1, 1, 2) +#pragma acc kernels loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) +#pragma acc kernels loop reduction(+ : x, y, z, x, y, a, a, b, c) #pragma acc kernels loop reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc kernels loop reduction(max : x, y, z) reduction(min : a, b, c) -#pragma acc kernels loop reduction(min : x, y, z) reduction(min : a, b, c) +#pragma acc kernels loop reduction(min : x, y, z, a, b, c) #pragma acc kernels loop reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc kernels loop reduction(|| : x, y, z) reduction(&& : a, b, c) -#pragma acc kernels loop reduction(&& : x, y, z) reduction(&& : a, b, c) -#pragma acc kernels loop reduction(max : x, y, max) reduction(max : x, y, min) +#pragma acc kernels loop reduction(&& : x, y, z, a, b, c) +#pragma acc kernels loop reduction(max : x, y, max, x, y, min) #pragma acc kernels loop reduction(+ : x, y, z) #pragma acc kernels loop reduction(* : x, y, z) #pragma acc kernels loop reduction(max : x, y, z) diff --git a/tests/builtin/reference/ref_kernels_loop_fortran.txt b/tests/builtin/reference/ref_kernels_loop_fortran.txt index 29f8ba8..b15806f 100644 --- a/tests/builtin/reference/ref_kernels_loop_fortran.txt +++ b/tests/builtin/reference/ref_kernels_loop_fortran.txt @@ -25,76 +25,76 @@ !$acc kernels loop self(5) !$acc kernels loop self(x==3) !$acc kernels loop device_type(x, y, z) -!$acc kernels loop copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -!$acc kernels loop copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +!$acc kernels loop copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc kernels loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc kernels loop copyin(x, y, z) copyin(readonly: a, b, c) !$acc kernels loop copyin(readonly: x, y, z) copyin(a, b, c) -!$acc kernels loop copyin(x, y, z) copyin(a, b, c) -!$acc kernels loop copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -!$acc kernels loop copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +!$acc kernels loop copyin(x, y, z, a, b, c) +!$acc kernels loop copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc kernels loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc kernels loop copyout(x, y, z) copyout(zero: a, b, c) !$acc kernels loop copyout(zero: x, y, z) copyout(a, b, c) -!$acc kernels loop copyout(x, y, z) copyout(a, b, c) -!$acc kernels loop create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -!$acc kernels loop create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +!$acc kernels loop copyout(x, y, z, a, b, c) +!$acc kernels loop create(zero: x, y, z, x, y, a, a, b, c) +!$acc kernels loop create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc kernels loop create(x, y, z) create(zero: a, b, c) !$acc kernels loop create(zero: x, y, z) create(a, b, c) -!$acc kernels loop create(x, y, z) create(a, b, c) +!$acc kernels loop create(x, y, z, a, b, c) !$acc kernels loop async(expression1) async(expression2) async(expression3) -!$acc kernels loop async(expression1) async(expression2) async(expression1) +!$acc kernels loop async(expression1) async(expression2) !$acc kernels loop async(expression1) async -!$acc kernels loop async async(expression1) async +!$acc kernels loop async async(expression1) !$acc kernels loop num_workers(expression1) num_workers(expression2) num_workers(expression3) -!$acc kernels loop num_workers(expression1) num_workers(expression2) num_workers(expression1) +!$acc kernels loop num_workers(expression1) num_workers(expression2) !$acc kernels loop vector_length(expression1) vector_length(expression2) vector_length(expression3) -!$acc kernels loop vector_length(expression1) vector_length(expression2) vector_length(expression1) +!$acc kernels loop vector_length(expression1) vector_length(expression2) !$acc kernels loop self(expression1) self(expression2) self(expression3) -!$acc kernels loop self(expression1) self(expression2) self(expression1) +!$acc kernels loop self(expression1) self(expression2) !$acc kernels loop self(expression1) self -!$acc kernels loop self self(expression1) self +!$acc kernels loop self self(expression1) !$acc kernels loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -!$acc kernels loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) -!$acc kernels loop wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) +!$acc kernels loop num_gangs(expression1) num_gangs(expression2) +!$acc kernels loop wait wait(a, b, c, d) !$acc kernels loop !$acc kernels loop private(a, b, c) !$acc kernels loop auto -!$acc kernels loop auto auto +!$acc kernels loop auto !$acc kernels loop collapse(1) !$acc kernels loop collapse(1) collapse(2) -!$acc kernels loop collapse(1) collapse(1) collapse(2) +!$acc kernels loop collapse(1) collapse(2) !$acc kernels loop device_type(a, b, c) !$acc kernels loop gang !$acc kernels loop gang(a, b, c) -!$acc kernels loop gang(a, b, c) gang(c) gang(d) +!$acc kernels loop gang(a, b, c, d) !$acc kernels loop gang(a, b, c) gang -!$acc kernels loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) +!$acc kernels loop gang gang(a, b, c, d) +!$acc kernels loop independent !$acc kernels loop independent -!$acc kernels loop independent independent !$acc kernels loop seq !$acc kernels loop vector(length: a) !$acc kernels loop vector(length: a) vector(length: b) -!$acc kernels loop vector(length: a) vector(length: a) +!$acc kernels loop vector(length: a) !$acc kernels loop vector(c) vector(length: c) !$acc kernels loop vector(c) vector(b) -!$acc kernels loop vector(c) vector(c) +!$acc kernels loop vector(c) !$acc kernels loop worker(num: a) !$acc kernels loop worker(num: a) worker(num: b) -!$acc kernels loop worker(num: a) worker(num: a) +!$acc kernels loop worker(num: a) !$acc kernels loop worker(c) worker(num: c) !$acc kernels loop worker(c) worker(b) -!$acc kernels loop worker(c) worker(c) +!$acc kernels loop worker(c) !$acc kernels loop tile(1) -!$acc kernels loop tile(1) tile(2) -!$acc kernels loop tile(1) tile(1) tile(2) -!$acc kernels loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) -!$acc kernels loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) +!$acc kernels loop tile(1, 2) +!$acc kernels loop tile(1, 1, 2) +!$acc kernels loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) +!$acc kernels loop reduction(+ : x, y, z, x, y, a, a, b, c) !$acc kernels loop reduction(+ : x, y, z) reduction(* : a, b, c) !$acc kernels loop reduction(max : x, y, z) reduction(min : a, b, c) -!$acc kernels loop reduction(min : x, y, z) reduction(min : a, b, c) +!$acc kernels loop reduction(min : x, y, z, a, b, c) !$acc kernels loop reduction(min : x, y, z) reduction(&& : a, b, c) !$acc kernels loop reduction(|| : x, y, z) reduction(&& : a, b, c) -!$acc kernels loop reduction(&& : x, y, z) reduction(&& : a, b, c) -!$acc kernels loop reduction(max : x, y, max) reduction(max : x, y, min) +!$acc kernels loop reduction(&& : x, y, z, a, b, c) +!$acc kernels loop reduction(max : x, y, max, x, y, min) !$acc kernels loop reduction(+ : x, y, z) !$acc kernels loop reduction(* : x, y, z) !$acc kernels loop reduction(max : x, y, z) diff --git a/tests/builtin/reference/ref_loop.txt b/tests/builtin/reference/ref_loop.txt index 155171b..92f4dae 100644 --- a/tests/builtin/reference/ref_loop.txt +++ b/tests/builtin/reference/ref_loop.txt @@ -1,43 +1,43 @@ #pragma acc loop #pragma acc loop private(a, b, c) #pragma acc loop auto -#pragma acc loop auto auto +#pragma acc loop auto #pragma acc loop collapse(1) #pragma acc loop collapse(1) collapse(2) -#pragma acc loop collapse(1) collapse(1) collapse(2) +#pragma acc loop collapse(1) collapse(2) #pragma acc loop device_type(a, b, c) #pragma acc loop gang #pragma acc loop gang(a, b, c) -#pragma acc loop gang(a, b, c) gang(c) gang(d) +#pragma acc loop gang(a, b, c, d) #pragma acc loop gang(a, b, c) gang -#pragma acc loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) +#pragma acc loop gang gang(a, b, c, d) +#pragma acc loop independent #pragma acc loop independent -#pragma acc loop independent independent #pragma acc loop seq #pragma acc loop vector(length: a) #pragma acc loop vector(length: a) vector(length: b) -#pragma acc loop vector(length: a) vector(length: a) +#pragma acc loop vector(length: a) #pragma acc loop vector(c) vector(length: c) #pragma acc loop vector(c) vector(b) -#pragma acc loop vector(c) vector(c) +#pragma acc loop vector(c) #pragma acc loop worker(num: a) #pragma acc loop worker(num: a) worker(num: b) -#pragma acc loop worker(num: a) worker(num: a) +#pragma acc loop worker(num: a) #pragma acc loop worker(c) worker(num: c) #pragma acc loop worker(c) worker(b) -#pragma acc loop worker(c) worker(c) +#pragma acc loop worker(c) #pragma acc loop tile(1) -#pragma acc loop tile(1) tile(2) -#pragma acc loop tile(1) tile(1) tile(2) -#pragma acc loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) -#pragma acc loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) +#pragma acc loop tile(1, 2) +#pragma acc loop tile(1, 1, 2) +#pragma acc loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) +#pragma acc loop reduction(+ : x, y, z, x, y, a, a, b, c) #pragma acc loop reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc loop reduction(max : x, y, z) reduction(min : a, b, c) -#pragma acc loop reduction(min : x, y, z) reduction(min : a, b, c) +#pragma acc loop reduction(min : x, y, z, a, b, c) #pragma acc loop reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc loop reduction(|| : x, y, z) reduction(&& : a, b, c) -#pragma acc loop reduction(&& : x, y, z) reduction(&& : a, b, c) -#pragma acc loop reduction(max : x, y, max) reduction(max : x, y, min) +#pragma acc loop reduction(&& : x, y, z, a, b, c) +#pragma acc loop reduction(max : x, y, max, x, y, min) #pragma acc loop device_type(x, y, z) #pragma acc loop reduction(+ : x, y, z) #pragma acc loop reduction(* : x, y, z) diff --git a/tests/builtin/reference/ref_loop_fortran.txt b/tests/builtin/reference/ref_loop_fortran.txt index 223639e..4b5c69c 100644 --- a/tests/builtin/reference/ref_loop_fortran.txt +++ b/tests/builtin/reference/ref_loop_fortran.txt @@ -1,43 +1,43 @@ !$acc loop !$acc loop private(a, b, c) !$acc loop auto -!$acc loop auto auto +!$acc loop auto !$acc loop collapse(1) !$acc loop collapse(1) collapse(2) -!$acc loop collapse(1) collapse(1) collapse(2) +!$acc loop collapse(1) collapse(2) !$acc loop device_type(a, b, c) !$acc loop gang !$acc loop gang(a, b, c) -!$acc loop gang(a, b, c) gang(c) gang(d) +!$acc loop gang(a, b, c, d) !$acc loop gang(a, b, c) gang -!$acc loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) +!$acc loop gang gang(a, b, c, d) +!$acc loop independent !$acc loop independent -!$acc loop independent independent !$acc loop seq !$acc loop vector(length: a) !$acc loop vector(length: a) vector(length: b) -!$acc loop vector(length: a) vector(length: a) +!$acc loop vector(length: a) !$acc loop vector(c) vector(length: c) !$acc loop vector(c) vector(b) -!$acc loop vector(c) vector(c) +!$acc loop vector(c) !$acc loop worker(num: a) !$acc loop worker(num: a) worker(num: b) -!$acc loop worker(num: a) worker(num: a) +!$acc loop worker(num: a) !$acc loop worker(c) worker(num: c) !$acc loop worker(c) worker(b) -!$acc loop worker(c) worker(c) +!$acc loop worker(c) !$acc loop tile(1) -!$acc loop tile(1) tile(2) -!$acc loop tile(1) tile(1) tile(2) -!$acc loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) -!$acc loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) +!$acc loop tile(1, 2) +!$acc loop tile(1, 1, 2) +!$acc loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) +!$acc loop reduction(+ : x, y, z, x, y, a, a, b, c) !$acc loop reduction(+ : x, y, z) reduction(* : a, b, c) !$acc loop reduction(max : x, y, z) reduction(min : a, b, c) -!$acc loop reduction(min : x, y, z) reduction(min : a, b, c) +!$acc loop reduction(min : x, y, z, a, b, c) !$acc loop reduction(min : x, y, z) reduction(&& : a, b, c) !$acc loop reduction(|| : x, y, z) reduction(&& : a, b, c) -!$acc loop reduction(&& : x, y, z) reduction(&& : a, b, c) -!$acc loop reduction(max : x, y, max) reduction(max : x, y, min) +!$acc loop reduction(&& : x, y, z, a, b, c) +!$acc loop reduction(max : x, y, max, x, y, min) !$acc loop device_type(x, y, z) !$acc loop reduction(+ : x, y, z) !$acc loop reduction(* : x, y, z) diff --git a/tests/builtin/reference/ref_parallel.txt b/tests/builtin/reference/ref_parallel.txt index 44129bf..9585970 100644 --- a/tests/builtin/reference/ref_parallel.txt +++ b/tests/builtin/reference/ref_parallel.txt @@ -44,42 +44,42 @@ #pragma acc parallel reduction(^ : x, y, z) #pragma acc parallel reduction(&& : x, y, z) #pragma acc parallel reduction(|| : x, y, z) -#pragma acc parallel copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -#pragma acc parallel copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +#pragma acc parallel copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc parallel copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc parallel copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc parallel copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc parallel copyin(x, y, z) copyin(a, b, c) -#pragma acc parallel copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -#pragma acc parallel copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +#pragma acc parallel copyin(x, y, z, a, b, c) +#pragma acc parallel copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc parallel copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc parallel copyout(x, y, z) copyout(zero: a, b, c) #pragma acc parallel copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc parallel copyout(x, y, z) copyout(a, b, c) -#pragma acc parallel create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -#pragma acc parallel create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +#pragma acc parallel copyout(x, y, z, a, b, c) +#pragma acc parallel create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc parallel create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc parallel create(x, y, z) create(zero: a, b, c) #pragma acc parallel create(zero: x, y, z) create(a, b, c) -#pragma acc parallel create(x, y, z) create(a, b, c) -#pragma acc parallel reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) +#pragma acc parallel create(x, y, z, a, b, c) +#pragma acc parallel reduction(+ : x, y, z, x, y, a, a, b, c) #pragma acc parallel reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc parallel reduction(max : x, y, z) reduction(min : a, b, c) -#pragma acc parallel reduction(min : x, y, z) reduction(min : a, b, c) +#pragma acc parallel reduction(min : x, y, z, a, b, c) #pragma acc parallel reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc parallel reduction(|| : x, y, z) reduction(&& : a, b, c) -#pragma acc parallel reduction(&& : x, y, z) reduction(&& : a, b, c) -#pragma acc parallel reduction(max : x, y, max) reduction(max : x, y, min) +#pragma acc parallel reduction(&& : x, y, z, a, b, c) +#pragma acc parallel reduction(max : x, y, max, x, y, min) #pragma acc parallel copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) #pragma acc parallel async(expression1) async(expression2) async(expression3) -#pragma acc parallel async(expression1) async(expression2) async(expression1) +#pragma acc parallel async(expression1) async(expression2) #pragma acc parallel async(expression1) async -#pragma acc parallel async async(expression1) async +#pragma acc parallel async async(expression1) #pragma acc parallel num_workers(expression1) num_workers(expression2) num_workers(expression3) -#pragma acc parallel num_workers(expression1) num_workers(expression2) num_workers(expression1) +#pragma acc parallel num_workers(expression1) num_workers(expression2) #pragma acc parallel vector_length(expression1) vector_length(expression2) vector_length(expression3) -#pragma acc parallel vector_length(expression1) vector_length(expression2) vector_length(expression1) +#pragma acc parallel vector_length(expression1) vector_length(expression2) #pragma acc parallel self(expression1) self(expression2) self(expression3) -#pragma acc parallel self(expression1) self(expression2) self(expression1) +#pragma acc parallel self(expression1) self(expression2) #pragma acc parallel self(expression1) self -#pragma acc parallel self self(expression1) self +#pragma acc parallel self self(expression1) #pragma acc parallel num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -#pragma acc parallel num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) -#pragma acc parallel wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) +#pragma acc parallel num_gangs(expression1) num_gangs(expression2) +#pragma acc parallel wait wait(a, b, c, d) diff --git a/tests/builtin/reference/ref_parallel_fortran.txt b/tests/builtin/reference/ref_parallel_fortran.txt index dc6abe6..d0ec1dc 100644 --- a/tests/builtin/reference/ref_parallel_fortran.txt +++ b/tests/builtin/reference/ref_parallel_fortran.txt @@ -44,44 +44,44 @@ !$acc parallel reduction(^ : x, y, z) !$acc parallel reduction(&& : x, y, z) !$acc parallel reduction(|| : x, y, z) -!$acc parallel copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -!$acc parallel copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +!$acc parallel copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc parallel copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc parallel copyin(x, y, z) copyin(readonly: a, b, c) !$acc parallel copyin(readonly: x, y, z) copyin(a, b, c) -!$acc parallel copyin(x, y, z) copyin(a, b, c) -!$acc parallel copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -!$acc parallel copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +!$acc parallel copyin(x, y, z, a, b, c) +!$acc parallel copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc parallel copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc parallel copyout(x, y, z) copyout(zero: a, b, c) !$acc parallel copyout(zero: x, y, z) copyout(a, b, c) -!$acc parallel copyout(x, y, z) copyout(a, b, c) -!$acc parallel create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -!$acc parallel create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +!$acc parallel copyout(x, y, z, a, b, c) +!$acc parallel create(zero: x, y, z, x, y, a, a, b, c) +!$acc parallel create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc parallel create(x, y, z) create(zero: a, b, c) !$acc parallel create(zero: x, y, z) create(a, b, c) -!$acc parallel create(x, y, z) create(a, b, c) -!$acc parallel reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) +!$acc parallel create(x, y, z, a, b, c) +!$acc parallel reduction(+ : x, y, z, x, y, a, a, b, c) !$acc parallel reduction(+ : x, y, z) reduction(* : a, b, c) !$acc parallel reduction(max : x, y, z) reduction(min : a, b, c) -!$acc parallel reduction(min : x, y, z) reduction(min : a, b, c) +!$acc parallel reduction(min : x, y, z, a, b, c) !$acc parallel reduction(min : x, y, z) reduction(&& : a, b, c) !$acc parallel reduction(|| : x, y, z) reduction(&& : a, b, c) -!$acc parallel reduction(&& : x, y, z) reduction(&& : a, b, c) -!$acc parallel reduction(max : x, y, max) reduction(max : x, y, min) +!$acc parallel reduction(&& : x, y, z, a, b, c) +!$acc parallel reduction(max : x, y, max, x, y, min) !$acc parallel copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) !$acc parallel async(expression1) async(expression2) async(expression3) -!$acc parallel async(expression1) async(expression2) async(expression1) +!$acc parallel async(expression1) async(expression2) !$acc parallel async(expression1) async -!$acc parallel async async(expression1) async +!$acc parallel async async(expression1) !$acc parallel num_workers(expression1) num_workers(expression2) num_workers(expression3) -!$acc parallel num_workers(expression1) num_workers(expression2) num_workers(expression1) +!$acc parallel num_workers(expression1) num_workers(expression2) !$acc parallel vector_length(expression1) vector_length(expression2) vector_length(expression3) -!$acc parallel vector_length(expression1) vector_length(expression2) vector_length(expression1) +!$acc parallel vector_length(expression1) vector_length(expression2) !$acc parallel self(expression1) self(expression2) self(expression3) -!$acc parallel self(expression1) self(expression2) self(expression1) +!$acc parallel self(expression1) self(expression2) !$acc parallel self(expression1) self -!$acc parallel self self(expression1) self +!$acc parallel self self(expression1) !$acc parallel num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -!$acc parallel num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) -!$acc parallel wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) +!$acc parallel num_gangs(expression1) num_gangs(expression2) +!$acc parallel wait wait(a, b, c, d) !$acc parallel deviceptr(a, b, c) !$acc end parallel diff --git a/tests/builtin/reference/ref_parallel_loop.txt b/tests/builtin/reference/ref_parallel_loop.txt index 6a0b5bd..7dd74c8 100644 --- a/tests/builtin/reference/ref_parallel_loop.txt +++ b/tests/builtin/reference/ref_parallel_loop.txt @@ -47,74 +47,74 @@ #pragma acc parallel loop reduction(^ : x, y, z) #pragma acc parallel loop reduction(&& : x, y, z) #pragma acc parallel loop reduction(|| : x, y, z) -#pragma acc parallel loop copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -#pragma acc parallel loop copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +#pragma acc parallel loop copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc parallel loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc parallel loop copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc parallel loop copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc parallel loop copyin(x, y, z) copyin(a, b, c) -#pragma acc parallel loop copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -#pragma acc parallel loop copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +#pragma acc parallel loop copyin(x, y, z, a, b, c) +#pragma acc parallel loop copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc parallel loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc parallel loop copyout(x, y, z) copyout(zero: a, b, c) #pragma acc parallel loop copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc parallel loop copyout(x, y, z) copyout(a, b, c) -#pragma acc parallel loop create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -#pragma acc parallel loop create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +#pragma acc parallel loop copyout(x, y, z, a, b, c) +#pragma acc parallel loop create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc parallel loop create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc parallel loop create(x, y, z) create(zero: a, b, c) #pragma acc parallel loop create(zero: x, y, z) create(a, b, c) -#pragma acc parallel loop create(x, y, z) create(a, b, c) -#pragma acc parallel loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) +#pragma acc parallel loop create(x, y, z, a, b, c) +#pragma acc parallel loop reduction(+ : x, y, z, x, y, a, a, b, c) #pragma acc parallel loop reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc parallel loop reduction(max : x, y, z) reduction(min : a, b, c) -#pragma acc parallel loop reduction(min : x, y, z) reduction(min : a, b, c) +#pragma acc parallel loop reduction(min : x, y, z, a, b, c) #pragma acc parallel loop reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc parallel loop reduction(|| : x, y, z) reduction(&& : a, b, c) -#pragma acc parallel loop reduction(&& : x, y, z) reduction(&& : a, b, c) -#pragma acc parallel loop reduction(max : x, y, max) reduction(max : x, y, min) +#pragma acc parallel loop reduction(&& : x, y, z, a, b, c) +#pragma acc parallel loop reduction(max : x, y, max, x, y, min) #pragma acc parallel loop copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) #pragma acc parallel loop async(expression1) async(expression2) async(expression3) -#pragma acc parallel loop async(expression1) async(expression2) async(expression1) +#pragma acc parallel loop async(expression1) async(expression2) #pragma acc parallel loop async(expression1) async -#pragma acc parallel loop async async(expression1) async +#pragma acc parallel loop async async(expression1) #pragma acc parallel loop num_workers(expression1) num_workers(expression2) num_workers(expression3) -#pragma acc parallel loop num_workers(expression1) num_workers(expression2) num_workers(expression1) +#pragma acc parallel loop num_workers(expression1) num_workers(expression2) #pragma acc parallel loop vector_length(expression1) vector_length(expression2) vector_length(expression3) -#pragma acc parallel loop vector_length(expression1) vector_length(expression2) vector_length(expression1) +#pragma acc parallel loop vector_length(expression1) vector_length(expression2) #pragma acc parallel loop self(expression1) self(expression2) self(expression3) -#pragma acc parallel loop self(expression1) self(expression2) self(expression1) +#pragma acc parallel loop self(expression1) self(expression2) #pragma acc parallel loop self(expression1) self -#pragma acc parallel loop self self(expression1) self +#pragma acc parallel loop self self(expression1) #pragma acc parallel loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -#pragma acc parallel loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) -#pragma acc parallel loop wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) +#pragma acc parallel loop num_gangs(expression1) num_gangs(expression2) +#pragma acc parallel loop wait wait(a, b, c, d) #pragma acc parallel loop #pragma acc parallel loop private(a, b, c) #pragma acc parallel loop auto -#pragma acc parallel loop auto auto +#pragma acc parallel loop auto #pragma acc parallel loop collapse(1) #pragma acc parallel loop collapse(1) collapse(2) -#pragma acc parallel loop collapse(1) collapse(1) collapse(2) +#pragma acc parallel loop collapse(1) collapse(2) #pragma acc parallel loop device_type(a, b, c) #pragma acc parallel loop gang #pragma acc parallel loop gang(a, b, c) -#pragma acc parallel loop gang(a, b, c) gang(c) gang(d) +#pragma acc parallel loop gang(a, b, c, d) #pragma acc parallel loop gang(a, b, c) gang -#pragma acc parallel loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) +#pragma acc parallel loop gang gang(a, b, c, d) +#pragma acc parallel loop independent #pragma acc parallel loop independent -#pragma acc parallel loop independent independent #pragma acc parallel loop seq #pragma acc parallel loop vector(length: a) #pragma acc parallel loop vector(length: a) vector(length: b) -#pragma acc parallel loop vector(length: a) vector(length: a) +#pragma acc parallel loop vector(length: a) #pragma acc parallel loop vector(c) vector(length: c) #pragma acc parallel loop vector(c) vector(b) -#pragma acc parallel loop vector(c) vector(c) +#pragma acc parallel loop vector(c) #pragma acc parallel loop worker(num: a) #pragma acc parallel loop worker(num: a) worker(num: b) -#pragma acc parallel loop worker(num: a) worker(num: a) +#pragma acc parallel loop worker(num: a) #pragma acc parallel loop worker(c) worker(num: c) #pragma acc parallel loop worker(c) worker(b) -#pragma acc parallel loop worker(c) worker(c) +#pragma acc parallel loop worker(c) #pragma acc parallel loop tile(1) -#pragma acc parallel loop tile(1) tile(2) -#pragma acc parallel loop tile(1) tile(1) tile(2) -#pragma acc parallel loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) +#pragma acc parallel loop tile(1, 2) +#pragma acc parallel loop tile(1, 1, 2) +#pragma acc parallel loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) diff --git a/tests/builtin/reference/ref_parallel_loop_fortran.txt b/tests/builtin/reference/ref_parallel_loop_fortran.txt index 23f61f0..9526ba9 100644 --- a/tests/builtin/reference/ref_parallel_loop_fortran.txt +++ b/tests/builtin/reference/ref_parallel_loop_fortran.txt @@ -47,75 +47,75 @@ !$acc parallel loop reduction(^ : x, y, z) !$acc parallel loop reduction(&& : x, y, z) !$acc parallel loop reduction(|| : x, y, z) -!$acc parallel loop copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -!$acc parallel loop copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +!$acc parallel loop copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc parallel loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc parallel loop copyin(x, y, z) copyin(readonly: a, b, c) !$acc parallel loop copyin(readonly: x, y, z) copyin(a, b, c) -!$acc parallel loop copyin(x, y, z) copyin(a, b, c) -!$acc parallel loop copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -!$acc parallel loop copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +!$acc parallel loop copyin(x, y, z, a, b, c) +!$acc parallel loop copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc parallel loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc parallel loop copyout(x, y, z) copyout(zero: a, b, c) !$acc parallel loop copyout(zero: x, y, z) copyout(a, b, c) -!$acc parallel loop copyout(x, y, z) copyout(a, b, c) -!$acc parallel loop create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -!$acc parallel loop create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +!$acc parallel loop copyout(x, y, z, a, b, c) +!$acc parallel loop create(zero: x, y, z, x, y, a, a, b, c) +!$acc parallel loop create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc parallel loop create(x, y, z) create(zero: a, b, c) !$acc parallel loop create(zero: x, y, z) create(a, b, c) -!$acc parallel loop create(x, y, z) create(a, b, c) -!$acc parallel loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) +!$acc parallel loop create(x, y, z, a, b, c) +!$acc parallel loop reduction(+ : x, y, z, x, y, a, a, b, c) !$acc parallel loop reduction(+ : x, y, z) reduction(* : a, b, c) !$acc parallel loop reduction(max : x, y, z) reduction(min : a, b, c) -!$acc parallel loop reduction(min : x, y, z) reduction(min : a, b, c) +!$acc parallel loop reduction(min : x, y, z, a, b, c) !$acc parallel loop reduction(min : x, y, z) reduction(&& : a, b, c) !$acc parallel loop reduction(|| : x, y, z) reduction(&& : a, b, c) -!$acc parallel loop reduction(&& : x, y, z) reduction(&& : a, b, c) -!$acc parallel loop reduction(max : x, y, max) reduction(max : x, y, min) +!$acc parallel loop reduction(&& : x, y, z, a, b, c) +!$acc parallel loop reduction(max : x, y, max, x, y, min) !$acc parallel loop copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) !$acc parallel loop async(expression1) async(expression2) async(expression3) -!$acc parallel loop async(expression1) async(expression2) async(expression1) +!$acc parallel loop async(expression1) async(expression2) !$acc parallel loop async(expression1) async -!$acc parallel loop async async(expression1) async +!$acc parallel loop async async(expression1) !$acc parallel loop num_workers(expression1) num_workers(expression2) num_workers(expression3) -!$acc parallel loop num_workers(expression1) num_workers(expression2) num_workers(expression1) +!$acc parallel loop num_workers(expression1) num_workers(expression2) !$acc parallel loop vector_length(expression1) vector_length(expression2) vector_length(expression3) -!$acc parallel loop vector_length(expression1) vector_length(expression2) vector_length(expression1) +!$acc parallel loop vector_length(expression1) vector_length(expression2) !$acc parallel loop self(expression1) self(expression2) self(expression3) -!$acc parallel loop self(expression1) self(expression2) self(expression1) +!$acc parallel loop self(expression1) self(expression2) !$acc parallel loop self(expression1) self -!$acc parallel loop self self(expression1) self +!$acc parallel loop self self(expression1) !$acc parallel loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression3) -!$acc parallel loop num_gangs(expression1) num_gangs(expression2) num_gangs(expression1) -!$acc parallel loop wait wait(a, b, c) wait wait(d) wait wait(d) wait(a, c, d) +!$acc parallel loop num_gangs(expression1) num_gangs(expression2) +!$acc parallel loop wait wait(a, b, c, d) !$acc parallel loop !$acc parallel loop private(a, b, c) !$acc parallel loop auto -!$acc parallel loop auto auto +!$acc parallel loop auto !$acc parallel loop collapse(1) !$acc parallel loop collapse(1) collapse(2) -!$acc parallel loop collapse(1) collapse(1) collapse(2) +!$acc parallel loop collapse(1) collapse(2) !$acc parallel loop device_type(a, b, c) !$acc parallel loop gang !$acc parallel loop gang(a, b, c) -!$acc parallel loop gang(a, b, c) gang(c) gang(d) +!$acc parallel loop gang(a, b, c, d) !$acc parallel loop gang(a, b, c) gang -!$acc parallel loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) +!$acc parallel loop gang gang(a, b, c, d) +!$acc parallel loop independent !$acc parallel loop independent -!$acc parallel loop independent independent !$acc parallel loop seq !$acc parallel loop vector(length: a) !$acc parallel loop vector(length: a) vector(length: b) -!$acc parallel loop vector(length: a) vector(length: a) +!$acc parallel loop vector(length: a) !$acc parallel loop vector(c) vector(length: c) !$acc parallel loop vector(c) vector(b) -!$acc parallel loop vector(c) vector(c) +!$acc parallel loop vector(c) !$acc parallel loop worker(num: a) !$acc parallel loop worker(num: a) worker(num: b) -!$acc parallel loop worker(num: a) worker(num: a) +!$acc parallel loop worker(num: a) !$acc parallel loop worker(c) worker(num: c) !$acc parallel loop worker(c) worker(b) -!$acc parallel loop worker(c) worker(c) +!$acc parallel loop worker(c) !$acc parallel loop tile(1) -!$acc parallel loop tile(1) tile(2) -!$acc parallel loop tile(1) tile(1) tile(2) -!$acc parallel loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) +!$acc parallel loop tile(1, 2) +!$acc parallel loop tile(1, 1, 2) +!$acc parallel loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) !$acc end parallel loop diff --git a/tests/builtin/reference/ref_routine.txt b/tests/builtin/reference/ref_routine.txt index 677a723..deec741 100644 --- a/tests/builtin/reference/ref_routine.txt +++ b/tests/builtin/reference/ref_routine.txt @@ -11,4 +11,4 @@ #pragma acc routine nohost #pragma acc routine bind(expression1) #pragma acc routine bind(expression1) bind(expression2) -#pragma acc routine bind(expression1) bind(expression1) +#pragma acc routine bind(expression1) diff --git a/tests/builtin/reference/ref_routine_fortran.txt b/tests/builtin/reference/ref_routine_fortran.txt index 59bda2b..ad0c372 100644 --- a/tests/builtin/reference/ref_routine_fortran.txt +++ b/tests/builtin/reference/ref_routine_fortran.txt @@ -11,4 +11,4 @@ !$acc routine nohost !$acc routine bind(expression1) !$acc routine bind(expression1) bind(expression2) -!$acc routine bind(expression1) bind(expression1) +!$acc routine bind(expression1) diff --git a/tests/builtin/reference/ref_serial.txt b/tests/builtin/reference/ref_serial.txt index 5f29962..f27a357 100644 --- a/tests/builtin/reference/ref_serial.txt +++ b/tests/builtin/reference/ref_serial.txt @@ -41,35 +41,35 @@ #pragma acc serial reduction(^ : x, y, z) #pragma acc serial reduction(&& : x, y, z) #pragma acc serial reduction(|| : x, y, z) -#pragma acc serial copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -#pragma acc serial copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +#pragma acc serial copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc serial copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc serial copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc serial copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc serial copyin(x, y, z) copyin(a, b, c) -#pragma acc serial copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -#pragma acc serial copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +#pragma acc serial copyin(x, y, z, a, b, c) +#pragma acc serial copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc serial copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc serial copyout(x, y, z) copyout(zero: a, b, c) #pragma acc serial copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc serial copyout(x, y, z) copyout(a, b, c) -#pragma acc serial create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -#pragma acc serial create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +#pragma acc serial copyout(x, y, z, a, b, c) +#pragma acc serial create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc serial create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc serial create(x, y, z) create(zero: a, b, c) #pragma acc serial create(zero: x, y, z) create(a, b, c) -#pragma acc serial create(x, y, z) create(a, b, c) -#pragma acc serial reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) +#pragma acc serial create(x, y, z, a, b, c) +#pragma acc serial reduction(+ : x, y, z, x, y, a, a, b, c) #pragma acc serial reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc serial reduction(max : x, y, z) reduction(min : a, b, c) -#pragma acc serial reduction(min : x, y, z) reduction(min : a, b, c) +#pragma acc serial reduction(min : x, y, z, a, b, c) #pragma acc serial reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc serial reduction(|| : x, y, z) reduction(&& : a, b, c) -#pragma acc serial reduction(&& : x, y, z) reduction(&& : a, b, c) -#pragma acc serial reduction(max : x, y, max) reduction(max : x, y, min) +#pragma acc serial reduction(&& : x, y, z, a, b, c) +#pragma acc serial reduction(max : x, y, max, x, y, min) #pragma acc serial copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) #pragma acc serial async(expression1) async(expression2) async(expression3) -#pragma acc serial async(expression1) async(expression2) async(expression1) +#pragma acc serial async(expression1) async(expression2) #pragma acc serial async(expression1) async -#pragma acc serial async async(expression1) async +#pragma acc serial async async(expression1) #pragma acc serial self(expression1) self(expression2) self(expression3) -#pragma acc serial self(expression1) self(expression2) self(expression1) +#pragma acc serial self(expression1) self(expression2) #pragma acc serial self(expression1) self -#pragma acc serial self self(expression1) self +#pragma acc serial self self(expression1) diff --git a/tests/builtin/reference/ref_serial_fortran.txt b/tests/builtin/reference/ref_serial_fortran.txt index 7303d45..9039cd6 100644 --- a/tests/builtin/reference/ref_serial_fortran.txt +++ b/tests/builtin/reference/ref_serial_fortran.txt @@ -41,36 +41,36 @@ !$acc serial reduction(^ : x, y, z) !$acc serial reduction(&& : x, y, z) !$acc serial reduction(|| : x, y, z) -!$acc serial copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -!$acc serial copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +!$acc serial copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc serial copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc serial copyin(x, y, z) copyin(readonly: a, b, c) !$acc serial copyin(readonly: x, y, z) copyin(a, b, c) -!$acc serial copyin(x, y, z) copyin(a, b, c) -!$acc serial copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -!$acc serial copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +!$acc serial copyin(x, y, z, a, b, c) +!$acc serial copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc serial copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc serial copyout(x, y, z) copyout(zero: a, b, c) !$acc serial copyout(zero: x, y, z) copyout(a, b, c) -!$acc serial copyout(x, y, z) copyout(a, b, c) -!$acc serial create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -!$acc serial create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +!$acc serial copyout(x, y, z, a, b, c) +!$acc serial create(zero: x, y, z, x, y, a, a, b, c) +!$acc serial create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc serial create(x, y, z) create(zero: a, b, c) !$acc serial create(zero: x, y, z) create(a, b, c) -!$acc serial create(x, y, z) create(a, b, c) -!$acc serial reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) +!$acc serial create(x, y, z, a, b, c) +!$acc serial reduction(+ : x, y, z, x, y, a, a, b, c) !$acc serial reduction(+ : x, y, z) reduction(* : a, b, c) !$acc serial reduction(max : x, y, z) reduction(min : a, b, c) -!$acc serial reduction(min : x, y, z) reduction(min : a, b, c) +!$acc serial reduction(min : x, y, z, a, b, c) !$acc serial reduction(min : x, y, z) reduction(&& : a, b, c) !$acc serial reduction(|| : x, y, z) reduction(&& : a, b, c) -!$acc serial reduction(&& : x, y, z) reduction(&& : a, b, c) -!$acc serial reduction(max : x, y, max) reduction(max : x, y, min) +!$acc serial reduction(&& : x, y, z, a, b, c) +!$acc serial reduction(max : x, y, max, x, y, min) !$acc serial copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) !$acc serial async(expression1) async(expression2) async(expression3) -!$acc serial async(expression1) async(expression2) async(expression1) +!$acc serial async(expression1) async(expression2) !$acc serial async(expression1) async -!$acc serial async async(expression1) async +!$acc serial async async(expression1) !$acc serial self(expression1) self(expression2) self(expression3) -!$acc serial self(expression1) self(expression2) self(expression1) +!$acc serial self(expression1) self(expression2) !$acc serial self(expression1) self -!$acc serial self self(expression1) self +!$acc serial self self(expression1) !$acc end serial diff --git a/tests/builtin/reference/ref_serial_loop.txt b/tests/builtin/reference/ref_serial_loop.txt index 51380c5..5ab3970 100644 --- a/tests/builtin/reference/ref_serial_loop.txt +++ b/tests/builtin/reference/ref_serial_loop.txt @@ -41,67 +41,67 @@ #pragma acc serial loop reduction(^ : x, y, z) #pragma acc serial loop reduction(&& : x, y, z) #pragma acc serial loop reduction(|| : x, y, z) -#pragma acc serial loop copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -#pragma acc serial loop copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +#pragma acc serial loop copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc serial loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc serial loop copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc serial loop copyin(readonly: x, y, z) copyin(a, b, c) -#pragma acc serial loop copyin(x, y, z) copyin(a, b, c) -#pragma acc serial loop copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -#pragma acc serial loop copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +#pragma acc serial loop copyin(x, y, z, a, b, c) +#pragma acc serial loop copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc serial loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc serial loop copyout(x, y, z) copyout(zero: a, b, c) #pragma acc serial loop copyout(zero: x, y, z) copyout(a, b, c) -#pragma acc serial loop copyout(x, y, z) copyout(a, b, c) -#pragma acc serial loop create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -#pragma acc serial loop create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +#pragma acc serial loop copyout(x, y, z, a, b, c) +#pragma acc serial loop create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc serial loop create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc serial loop create(x, y, z) create(zero: a, b, c) #pragma acc serial loop create(zero: x, y, z) create(a, b, c) -#pragma acc serial loop create(x, y, z) create(a, b, c) -#pragma acc serial loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) +#pragma acc serial loop create(x, y, z, a, b, c) +#pragma acc serial loop reduction(+ : x, y, z, x, y, a, a, b, c) #pragma acc serial loop reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc serial loop reduction(max : x, y, z) reduction(min : a, b, c) -#pragma acc serial loop reduction(min : x, y, z) reduction(min : a, b, c) +#pragma acc serial loop reduction(min : x, y, z, a, b, c) #pragma acc serial loop reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc serial loop reduction(|| : x, y, z) reduction(&& : a, b, c) -#pragma acc serial loop reduction(&& : x, y, z) reduction(&& : a, b, c) -#pragma acc serial loop reduction(max : x, y, max) reduction(max : x, y, min) +#pragma acc serial loop reduction(&& : x, y, z, a, b, c) +#pragma acc serial loop reduction(max : x, y, max, x, y, min) #pragma acc serial loop copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) #pragma acc serial loop async(expression1) async(expression2) async(expression3) -#pragma acc serial loop async(expression1) async(expression2) async(expression1) +#pragma acc serial loop async(expression1) async(expression2) #pragma acc serial loop async(expression1) async -#pragma acc serial loop async async(expression1) async +#pragma acc serial loop async async(expression1) #pragma acc serial loop self(expression1) self(expression2) self(expression3) -#pragma acc serial loop self(expression1) self(expression2) self(expression1) +#pragma acc serial loop self(expression1) self(expression2) #pragma acc serial loop self(expression1) self -#pragma acc serial loop self self(expression1) self +#pragma acc serial loop self self(expression1) #pragma acc serial loop #pragma acc serial loop private(a, b, c) #pragma acc serial loop auto -#pragma acc serial loop auto auto +#pragma acc serial loop auto #pragma acc serial loop collapse(1) #pragma acc serial loop collapse(1) collapse(2) -#pragma acc serial loop collapse(1) collapse(1) collapse(2) +#pragma acc serial loop collapse(1) collapse(2) #pragma acc serial loop device_type(a, b, c) #pragma acc serial loop gang #pragma acc serial loop gang(a, b, c) -#pragma acc serial loop gang(a, b, c) gang(c) gang(d) +#pragma acc serial loop gang(a, b, c, d) #pragma acc serial loop gang(a, b, c) gang -#pragma acc serial loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) +#pragma acc serial loop gang gang(a, b, c, d) +#pragma acc serial loop independent #pragma acc serial loop independent -#pragma acc serial loop independent independent #pragma acc serial loop seq #pragma acc serial loop vector(length: a) #pragma acc serial loop vector(length: a) vector(length: b) -#pragma acc serial loop vector(length: a) vector(length: a) +#pragma acc serial loop vector(length: a) #pragma acc serial loop vector(c) vector(length: c) #pragma acc serial loop vector(c) vector(b) -#pragma acc serial loop vector(c) vector(c) +#pragma acc serial loop vector(c) #pragma acc serial loop worker(num: a) #pragma acc serial loop worker(num: a) worker(num: b) -#pragma acc serial loop worker(num: a) worker(num: a) +#pragma acc serial loop worker(num: a) #pragma acc serial loop worker(c) worker(num: c) #pragma acc serial loop worker(c) worker(b) -#pragma acc serial loop worker(c) worker(c) +#pragma acc serial loop worker(c) #pragma acc serial loop tile(1) -#pragma acc serial loop tile(1) tile(2) -#pragma acc serial loop tile(1) tile(1) tile(2) -#pragma acc serial loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) +#pragma acc serial loop tile(1, 2) +#pragma acc serial loop tile(1, 1, 2) +#pragma acc serial loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) diff --git a/tests/builtin/reference/ref_serial_loop_fortran.txt b/tests/builtin/reference/ref_serial_loop_fortran.txt index d12ec11..189b978 100644 --- a/tests/builtin/reference/ref_serial_loop_fortran.txt +++ b/tests/builtin/reference/ref_serial_loop_fortran.txt @@ -41,68 +41,68 @@ !$acc serial loop reduction(^ : x, y, z) !$acc serial loop reduction(&& : x, y, z) !$acc serial loop reduction(|| : x, y, z) -!$acc serial loop copyin(readonly: x, y, z) copyin(readonly: x, y, a) copyin(readonly: a, b, c) -!$acc serial loop copyin(readonly: x, y, z) copyin(readonly: a, b, c) copyin(readonly: 1, 2, 3) +!$acc serial loop copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc serial loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc serial loop copyin(x, y, z) copyin(readonly: a, b, c) !$acc serial loop copyin(readonly: x, y, z) copyin(a, b, c) -!$acc serial loop copyin(x, y, z) copyin(a, b, c) -!$acc serial loop copyout(zero: x, y, z) copyout(zero: x, y, a) copyout(zero: a, b, c) -!$acc serial loop copyout(zero: x, y, z) copyout(zero: a, b, c) copyout(zero: 1, 2, 3) +!$acc serial loop copyin(x, y, z, a, b, c) +!$acc serial loop copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc serial loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc serial loop copyout(x, y, z) copyout(zero: a, b, c) !$acc serial loop copyout(zero: x, y, z) copyout(a, b, c) -!$acc serial loop copyout(x, y, z) copyout(a, b, c) -!$acc serial loop create(zero: x, y, z) create(zero: x, y, a) create(zero: a, b, c) -!$acc serial loop create(zero: x, y, z) create(zero: a, b, c) create(zero: 1, 2, 3) +!$acc serial loop copyout(x, y, z, a, b, c) +!$acc serial loop create(zero: x, y, z, x, y, a, a, b, c) +!$acc serial loop create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc serial loop create(x, y, z) create(zero: a, b, c) !$acc serial loop create(zero: x, y, z) create(a, b, c) -!$acc serial loop create(x, y, z) create(a, b, c) -!$acc serial loop reduction(+ : x, y, z) reduction(+ : x, y, a) reduction(+ : a, b, c) +!$acc serial loop create(x, y, z, a, b, c) +!$acc serial loop reduction(+ : x, y, z, x, y, a, a, b, c) !$acc serial loop reduction(+ : x, y, z) reduction(* : a, b, c) !$acc serial loop reduction(max : x, y, z) reduction(min : a, b, c) -!$acc serial loop reduction(min : x, y, z) reduction(min : a, b, c) +!$acc serial loop reduction(min : x, y, z, a, b, c) !$acc serial loop reduction(min : x, y, z) reduction(&& : a, b, c) !$acc serial loop reduction(|| : x, y, z) reduction(&& : a, b, c) -!$acc serial loop reduction(&& : x, y, z) reduction(&& : a, b, c) -!$acc serial loop reduction(max : x, y, max) reduction(max : x, y, min) +!$acc serial loop reduction(&& : x, y, z, a, b, c) +!$acc serial loop reduction(max : x, y, max, x, y, min) !$acc serial loop copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) !$acc serial loop async(expression1) async(expression2) async(expression3) -!$acc serial loop async(expression1) async(expression2) async(expression1) +!$acc serial loop async(expression1) async(expression2) !$acc serial loop async(expression1) async -!$acc serial loop async async(expression1) async +!$acc serial loop async async(expression1) !$acc serial loop self(expression1) self(expression2) self(expression3) -!$acc serial loop self(expression1) self(expression2) self(expression1) +!$acc serial loop self(expression1) self(expression2) !$acc serial loop self(expression1) self -!$acc serial loop self self(expression1) self +!$acc serial loop self self(expression1) !$acc serial loop !$acc serial loop private(a, b, c) !$acc serial loop auto -!$acc serial loop auto auto +!$acc serial loop auto !$acc serial loop collapse(1) !$acc serial loop collapse(1) collapse(2) -!$acc serial loop collapse(1) collapse(1) collapse(2) +!$acc serial loop collapse(1) collapse(2) !$acc serial loop device_type(a, b, c) !$acc serial loop gang !$acc serial loop gang(a, b, c) -!$acc serial loop gang(a, b, c) gang(c) gang(d) +!$acc serial loop gang(a, b, c, d) !$acc serial loop gang(a, b, c) gang -!$acc serial loop gang gang(a, b, c) gang gang(d) gang gang(d) gang(a, c, d) +!$acc serial loop gang gang(a, b, c, d) +!$acc serial loop independent !$acc serial loop independent -!$acc serial loop independent independent !$acc serial loop seq !$acc serial loop vector(length: a) !$acc serial loop vector(length: a) vector(length: b) -!$acc serial loop vector(length: a) vector(length: a) +!$acc serial loop vector(length: a) !$acc serial loop vector(c) vector(length: c) !$acc serial loop vector(c) vector(b) -!$acc serial loop vector(c) vector(c) +!$acc serial loop vector(c) !$acc serial loop worker(num: a) !$acc serial loop worker(num: a) worker(num: b) -!$acc serial loop worker(num: a) worker(num: a) +!$acc serial loop worker(num: a) !$acc serial loop worker(c) worker(num: c) !$acc serial loop worker(c) worker(b) -!$acc serial loop worker(c) worker(c) +!$acc serial loop worker(c) !$acc serial loop tile(1) -!$acc serial loop tile(1) tile(2) -!$acc serial loop tile(1) tile(1) tile(2) -!$acc serial loop tile(1) tile(1) tile(2) worker(num: a) worker(num: 5) independent collapse(1) +!$acc serial loop tile(1, 2) +!$acc serial loop tile(1, 1, 2) +!$acc serial loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) !$acc end serial loop diff --git a/tests/builtin/reference/ref_set.txt b/tests/builtin/reference/ref_set.txt index 148e1c0..d1e2a99 100644 --- a/tests/builtin/reference/ref_set.txt +++ b/tests/builtin/reference/ref_set.txt @@ -1,6 +1,6 @@ #pragma acc set default_async(3) -#pragma acc set default_async(3) default_async(3) default_async(4) +#pragma acc set default_async(3) default_async(4) #pragma acc set device_type(a, b, c) #pragma acc set if(5) #pragma acc set if(x==3) -#pragma acc set device_num(3) device_num(3) device_num(4) +#pragma acc set device_num(3) device_num(4) diff --git a/tests/builtin/reference/ref_set_fortran.txt b/tests/builtin/reference/ref_set_fortran.txt index 6e4796f..f9e2bef 100644 --- a/tests/builtin/reference/ref_set_fortran.txt +++ b/tests/builtin/reference/ref_set_fortran.txt @@ -1,6 +1,6 @@ !$acc set default_async(3) -!$acc set default_async(3) default_async(3) default_async(4) +!$acc set default_async(3) default_async(4) !$acc set device_type(a, b, c) !$acc set if(5) !$acc set if(x==3) -!$acc set device_num(3) device_num(3) device_num(4) +!$acc set device_num(3) device_num(4) diff --git a/tests/builtin/reference/ref_update.txt b/tests/builtin/reference/ref_update.txt index 1a4be4d..f805cea 100644 --- a/tests/builtin/reference/ref_update.txt +++ b/tests/builtin/reference/ref_update.txt @@ -1,23 +1,23 @@ #pragma acc update async(5) #pragma acc update async(expression1) async(expression2) async(expression3) -#pragma acc update async(expression1) async(expression2) async(expression1) +#pragma acc update async(expression1) async(expression2) #pragma acc update async(expression1) async -#pragma acc update async async(expression1) async +#pragma acc update async async(expression1) #pragma acc update device_type(x, y, z) #pragma acc update wait(queues::a, devnum::b, devnum::queues::c) -#pragma acc update wait(queues::a, devnum::b, devnum::queues::c) wait(queues::b, devnum::b, devnum::queues::c) -#pragma acc update wait(queues::a, devnum::b, devnum::queues::c) wait(queues::a, devnum::b, devnum::queues::c) +#pragma acc update wait(queues::a, devnum::b, devnum::queues::c, queues::b) +#pragma acc update wait(queues::a, devnum::b, devnum::queues::c) #pragma acc update wait(queues: 12, 23, 34) -#pragma acc update wait(queues: 12, 23, 34) wait(queues: 12, 23, 34) wait(queues: 12, 23, 35) +#pragma acc update wait(queues: 12, 23, 34, 35) #pragma acc update wait(devnum: 12: queues: 23, 34) #pragma acc update wait(devnum: 12: queues: 23, 34) wait(devnum: 13: queues: 23, 34) -#pragma acc update wait(devnum: 12: queues: 23, 34) wait(devnum: 12: queues: 23, 38) +#pragma acc update wait(devnum: 12: queues: 23, 34, 38) #pragma acc update wait(devnum: devnum::devnum::z: 23, 34) -#pragma acc update wait(23, 34) wait(23, 34, 35) -#pragma acc update wait wait +#pragma acc update wait(23, 34, 35) +#pragma acc update wait #pragma acc update if(5) #pragma acc update if(x==3) #pragma acc update host(x, y) -#pragma acc update device(x, y) device(x, y) -#pragma acc update device(x, y) device(x, y) device(x, y) -#pragma acc update self(x, y) self(x, y) self(x, y, z) +#pragma acc update device(x, y, x, y) +#pragma acc update device(x, y, x, y, x, y) +#pragma acc update self(x, y, x, y, x, y, z) diff --git a/tests/builtin/reference/ref_update_fortran.txt b/tests/builtin/reference/ref_update_fortran.txt index 54b1f13..0137ce7 100644 --- a/tests/builtin/reference/ref_update_fortran.txt +++ b/tests/builtin/reference/ref_update_fortran.txt @@ -1,23 +1,23 @@ !$acc update async(5) !$acc update async(expression1) async(expression2) async(expression3) -!$acc update async(expression1) async(expression2) async(expression1) +!$acc update async(expression1) async(expression2) !$acc update async(expression1) async -!$acc update async async(expression1) async +!$acc update async async(expression1) !$acc update device_type(x, y, z) !$acc update wait(queues::a, devnum::b, devnum::queues::c) -!$acc update wait(queues::a, devnum::b, devnum::queues::c) wait(queues::b, devnum::b, devnum::queues::c) -!$acc update wait(queues::a, devnum::b, devnum::queues::c) wait(queues::a, devnum::b, devnum::queues::c) +!$acc update wait(queues::a, devnum::b, devnum::queues::c, queues::b) +!$acc update wait(queues::a, devnum::b, devnum::queues::c) !$acc update wait(queues: 12, 23, 34) -!$acc update wait(queues: 12, 23, 34) wait(queues: 12, 23, 34) wait(queues: 12, 23, 35) +!$acc update wait(queues: 12, 23, 34, 35) !$acc update wait(devnum: 12: queues: 23, 34) !$acc update wait(devnum: 12: queues: 23, 34) wait(devnum: 13: queues: 23, 34) -!$acc update wait(devnum: 12: queues: 23, 34) wait(devnum: 12: queues: 23, 38) +!$acc update wait(devnum: 12: queues: 23, 34, 38) !$acc update wait(devnum: devnum::devnum::z: 23, 34) -!$acc update wait(23, 34) wait(23, 34, 35) -!$acc update wait wait +!$acc update wait(23, 34, 35) +!$acc update wait !$acc update if(5) !$acc update if(x==3) !$acc update host(x, y) -!$acc update device(x, y) device(x, y) -!$acc update device(x, y) device(x, y) device(x, y) -!$acc update self(x, y) self(x, y) self(x, y, z) +!$acc update device(x, y, x, y) +!$acc update device(x, y, x, y, x, y) +!$acc update self(x, y, x, y, x, y, z) From b6456ec5f2342f9ac9372e355353f7aa72e29150 Mon Sep 17 00:00:00 2001 From: Anjia Wang Date: Mon, 24 Nov 2025 05:52:50 +0000 Subject: [PATCH 5/6] Deduplicate merged clause payloads for normalized built-in tests --- src/OpenACCASTConstructor.cpp | 6 ++++ src/OpenACCASTConstructor.h | 2 ++ src/OpenACCIR.cpp | 32 ++++++++++++------- src/OpenACCIR.h | 30 +++++++++++++++-- tests/builtin/reference/ref_data.txt | 6 ++-- tests/builtin/reference/ref_data_fortran.txt | 6 ++-- tests/builtin/reference/ref_declare.txt | 2 +- .../builtin/reference/ref_declare_fortran.txt | 2 +- tests/builtin/reference/ref_enter_data.txt | 2 +- .../reference/ref_enter_data_fortran.txt | 2 +- tests/builtin/reference/ref_host_data.txt | 2 +- .../reference/ref_host_data_fortran.txt | 2 +- tests/builtin/reference/ref_kernels.txt | 6 ++-- .../builtin/reference/ref_kernels_fortran.txt | 6 ++-- tests/builtin/reference/ref_kernels_loop.txt | 10 +++--- .../reference/ref_kernels_loop_fortran.txt | 10 +++--- tests/builtin/reference/ref_loop.txt | 4 +-- tests/builtin/reference/ref_loop_fortran.txt | 4 +-- tests/builtin/reference/ref_parallel.txt | 10 +++--- .../reference/ref_parallel_fortran.txt | 10 +++--- tests/builtin/reference/ref_parallel_loop.txt | 10 +++--- .../reference/ref_parallel_loop_fortran.txt | 10 +++--- tests/builtin/reference/ref_serial.txt | 10 +++--- .../builtin/reference/ref_serial_fortran.txt | 10 +++--- tests/builtin/reference/ref_serial_loop.txt | 10 +++--- .../reference/ref_serial_loop_fortran.txt | 10 +++--- tests/builtin/reference/ref_update.txt | 6 ++-- .../builtin/reference/ref_update_fortran.txt | 6 ++-- 28 files changed, 134 insertions(+), 92 deletions(-) diff --git a/src/OpenACCASTConstructor.cpp b/src/OpenACCASTConstructor.cpp index b4ad566..6fa9d9d 100644 --- a/src/OpenACCASTConstructor.cpp +++ b/src/OpenACCASTConstructor.cpp @@ -663,6 +663,12 @@ void OpenACCIRConstructor::enterUse_device_clause( current_clause = current_directive->addOpenACCClause(ACCC_use_device); } +void OpenACCIRConstructor::exitUse_device_clause( + accparser::Use_device_clauseContext *ctx) { + static_cast(current_clause) + ->mergeClause(current_directive, current_clause); +} + void OpenACCIRConstructor::enterVector_clause( accparser::Vector_clauseContext *ctx) { current_clause = current_directive->addOpenACCClause(ACCC_vector); diff --git a/src/OpenACCASTConstructor.h b/src/OpenACCASTConstructor.h index c5d48b0..e128163 100644 --- a/src/OpenACCASTConstructor.h +++ b/src/OpenACCASTConstructor.h @@ -205,6 +205,8 @@ class OpenACCIRConstructor : public accparserBaseListener { enterUpdate_clause(accparser::Update_clauseContext * /*ctx*/) override; virtual void enterUse_device_clause( accparser::Use_device_clauseContext * /*ctx*/) override; + virtual void exitUse_device_clause( + accparser::Use_device_clauseContext * /*ctx*/) override; virtual void enterVector_clause(accparser::Vector_clauseContext * /*ctx*/) override; virtual void exitVector_clause_modifier( diff --git a/src/OpenACCIR.cpp b/src/OpenACCIR.cpp index 474de7e..05d5c69 100644 --- a/src/OpenACCIR.cpp +++ b/src/OpenACCIR.cpp @@ -8,6 +8,13 @@ bool OpenACCDirective::enable_clause_merging = false; void OpenACCClause::addLangExpr(const OpenACCExpressionItem &expression, int line, int col) { + if (isClauseMergingEnabled()) { + for (const auto &prev : expressions) { + if (prev.text == expression.text) { + return; + } + } + } expressions.push_back(expression); locations.push_back(ACC_SourceLocation(line, col)); }; @@ -394,7 +401,16 @@ void OpenACCCollapseClause::mergeClause(OpenACCDirective *directive, static void mergeVarList(OpenACCVarListClause *existing, OpenACCVarListClause *incoming) { for (const auto &var : incoming->getVars()) { - existing->addVar(var); + bool seen = false; + for (const auto &prev : existing->getVars()) { + if (prev.text == var.text) { + seen = true; + break; + } + } + if (!seen) { + existing->addVar(var); + } } } @@ -568,9 +584,7 @@ void OpenACCCopyinClause::mergeClause(OpenACCDirective *directive, ((OpenACCClause *)current_clause)->getOriginalKeyword()) { auto *existing = static_cast(*it); auto *incoming = static_cast(current_clause); - for (const auto &var : incoming->getVars()) { - existing->addVar(var); - } + mergeVarList(existing, incoming); current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); break; @@ -616,9 +630,7 @@ void OpenACCCopyoutClause::mergeClause(OpenACCDirective *directive, ((OpenACCClause *)current_clause)->getOriginalKeyword()) { auto *existing = static_cast(*it); auto *incoming = static_cast(current_clause); - for (const auto &var : incoming->getVars()) { - existing->addVar(var); - } + mergeVarList(existing, incoming); current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); break; @@ -664,9 +676,7 @@ void OpenACCCreateClause::mergeClause(OpenACCDirective *directive, ((OpenACCClause *)current_clause)->getOriginalKeyword()) { auto *existing = static_cast(*it); auto *incoming = static_cast(current_clause); - for (const auto &var : incoming->getVars()) { - existing->addVar(var); - } + mergeVarList(existing, incoming); current_clauses->pop_back(); directive->getClausesInOriginalOrder()->pop_back(); break; @@ -896,8 +906,6 @@ OpenACCClause *OpenACCUseDeviceClause::addClause(OpenACCDirective *directive) { current_clauses = new std::vector(); current_clauses->push_back(new_clause); (*all_clauses)[ACCC_use_device] = current_clauses; - } else if (OpenACCDirective::getClauseMerging()) { - new_clause = current_clauses->at(0); } else { new_clause = new OpenACCUseDeviceClause(); current_clauses->push_back(new_clause); diff --git a/src/OpenACCIR.h b/src/OpenACCIR.h index b46ec9a..c6b851d 100644 --- a/src/OpenACCIR.h +++ b/src/OpenACCIR.h @@ -18,6 +18,9 @@ struct OpenACCIdentifier { bool is_string_literal = false; }; +class OpenACCDirective; +bool isClauseMergingEnabled(); + enum OpenACCBaseLang { ACC_Lang_C, ACC_Lang_Cplusplus, @@ -116,7 +119,16 @@ class OpenACCVarListClause : public OpenACCClause { OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { vars.push_back(OpenACCExpressionItem{expr, sep}); } - void addVar(const OpenACCExpressionItem &item) { vars.push_back(item); } + void addVar(const OpenACCExpressionItem &item) { + if (isClauseMergingEnabled()) { + for (const auto &prev : vars) { + if (prev.text == item.text) { + return; + } + } + } + vars.push_back(item); + } const std::vector &getVars() const { return vars; } @@ -252,6 +264,10 @@ class OpenACCDirective : public ACC_SourceLocation { OpenACCBaseLang getBaseLang() { return lang; }; }; +inline bool isClauseMergingEnabled() { + return OpenACCDirective::getClauseMerging(); +} + // Cache directive class OpenACCCacheDirective : public OpenACCDirective { protected: @@ -627,7 +643,17 @@ class OpenACCDeviceClause : public OpenACCClause { public: OpenACCDeviceClause() : OpenACCClause(ACCC_device) {} - void addDevice(const OpenACCExpressionItem &expr) { devices.push_back(expr); } + void addDevice(const OpenACCExpressionItem &expr, + bool dedup_if_merging = true) { + if (dedup_if_merging && isClauseMergingEnabled()) { + for (const auto &prev : devices) { + if (prev.text == expr.text) { + return; + } + } + } + devices.push_back(expr); + } void addDevice(const std::string &expr, OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { addDevice(OpenACCExpressionItem{expr, sep}); diff --git a/tests/builtin/reference/ref_data.txt b/tests/builtin/reference/ref_data.txt index 13d2a8d..8878559 100644 --- a/tests/builtin/reference/ref_data.txt +++ b/tests/builtin/reference/ref_data.txt @@ -18,17 +18,17 @@ #pragma acc data if(x==3) #pragma acc data no_create(a, b, c) #pragma acc data present(a, b, c) -#pragma acc data copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc data copyin(readonly: x, y, z, a, b, c) #pragma acc data copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc data copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc data copyin(readonly: x, y, z) copyin(a, b, c) #pragma acc data copyin(x, y, z, a, b, c) -#pragma acc data copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc data copyout(zero: x, y, z, a, b, c) #pragma acc data copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc data copyout(x, y, z) copyout(zero: a, b, c) #pragma acc data copyout(zero: x, y, z) copyout(a, b, c) #pragma acc data copyout(x, y, z, a, b, c) -#pragma acc data create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc data create(zero: x, y, z, a, b, c) #pragma acc data create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc data create(x, y, z) create(zero: a, b, c) #pragma acc data create(zero: x, y, z) create(a, b, c) diff --git a/tests/builtin/reference/ref_data_fortran.txt b/tests/builtin/reference/ref_data_fortran.txt index 1a64fd1..7d85701 100644 --- a/tests/builtin/reference/ref_data_fortran.txt +++ b/tests/builtin/reference/ref_data_fortran.txt @@ -18,17 +18,17 @@ !$acc data if(x==3) !$acc data no_create(a, b, c) !$acc data present(a, b, c) -!$acc data copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc data copyin(readonly: x, y, z, a, b, c) !$acc data copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc data copyin(x, y, z) copyin(readonly: a, b, c) !$acc data copyin(readonly: x, y, z) copyin(a, b, c) !$acc data copyin(x, y, z, a, b, c) -!$acc data copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc data copyout(zero: x, y, z, a, b, c) !$acc data copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc data copyout(x, y, z) copyout(zero: a, b, c) !$acc data copyout(zero: x, y, z) copyout(a, b, c) !$acc data copyout(x, y, z, a, b, c) -!$acc data create(zero: x, y, z, x, y, a, a, b, c) +!$acc data create(zero: x, y, z, a, b, c) !$acc data create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc data create(x, y, z) create(zero: a, b, c) !$acc data create(zero: x, y, z) create(a, b, c) diff --git a/tests/builtin/reference/ref_declare.txt b/tests/builtin/reference/ref_declare.txt index fb34ea8..f66e2b8 100644 --- a/tests/builtin/reference/ref_declare.txt +++ b/tests/builtin/reference/ref_declare.txt @@ -3,7 +3,7 @@ #pragma acc declare copyin(readonly: m, n) #pragma acc declare copyin(readonly: m, n, readonly) #pragma acc declare copyin(readonly: readonly::m, n, readonly) -#pragma acc declare copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc declare copyin(readonly: x, y, z, a, b, c) #pragma acc declare copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc declare copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc declare copyin(readonly: x, y, z) copyin(a, b, c) diff --git a/tests/builtin/reference/ref_declare_fortran.txt b/tests/builtin/reference/ref_declare_fortran.txt index bcaa591..97b9724 100644 --- a/tests/builtin/reference/ref_declare_fortran.txt +++ b/tests/builtin/reference/ref_declare_fortran.txt @@ -3,7 +3,7 @@ !$acc declare copyin(readonly: m, n) !$acc declare copyin(readonly: m, n, readonly) !$acc declare copyin(readonly: readonly::m, n, readonly) -!$acc declare copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc declare copyin(readonly: x, y, z, a, b, c) !$acc declare copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc declare copyin(x, y, z) copyin(readonly: a, b, c) !$acc declare copyin(readonly: x, y, z) copyin(a, b, c) diff --git a/tests/builtin/reference/ref_enter_data.txt b/tests/builtin/reference/ref_enter_data.txt index 2552a55..8882619 100644 --- a/tests/builtin/reference/ref_enter_data.txt +++ b/tests/builtin/reference/ref_enter_data.txt @@ -8,7 +8,7 @@ #pragma acc enter data create(zero: zero::12, 23, 34) #pragma acc enter data if(5) #pragma acc enter data if(x==3) -#pragma acc enter data create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc enter data create(zero: x, y, z, a, b, c) #pragma acc enter data create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc enter data create(x, y, z) create(zero: a, b, c) #pragma acc enter data create(zero: x, y, z) create(a, b, c) diff --git a/tests/builtin/reference/ref_enter_data_fortran.txt b/tests/builtin/reference/ref_enter_data_fortran.txt index 11e926f..5006733 100644 --- a/tests/builtin/reference/ref_enter_data_fortran.txt +++ b/tests/builtin/reference/ref_enter_data_fortran.txt @@ -8,7 +8,7 @@ !$acc enter data create(zero: zero::12, 23, 34) !$acc enter data if(5) !$acc enter data if(x==3) -!$acc enter data create(zero: x, y, z, x, y, a, a, b, c) +!$acc enter data create(zero: x, y, z, a, b, c) !$acc enter data create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc enter data create(x, y, z) create(zero: a, b, c) !$acc enter data create(zero: x, y, z) create(a, b, c) diff --git a/tests/builtin/reference/ref_host_data.txt b/tests/builtin/reference/ref_host_data.txt index 4f3df27..1f41006 100644 --- a/tests/builtin/reference/ref_host_data.txt +++ b/tests/builtin/reference/ref_host_data.txt @@ -3,4 +3,4 @@ #pragma acc host_data if(5) if_present #pragma acc host_data use_device(a, b, c) #pragma acc host_data use_device(a, b, c) if(5) if_present -#pragma acc host_data use_device(a, b, c, a, b, c, d) if(5) if_present +#pragma acc host_data use_device(a, b, c, d) if(5) if_present diff --git a/tests/builtin/reference/ref_host_data_fortran.txt b/tests/builtin/reference/ref_host_data_fortran.txt index 34424c8..6cbf003 100644 --- a/tests/builtin/reference/ref_host_data_fortran.txt +++ b/tests/builtin/reference/ref_host_data_fortran.txt @@ -4,5 +4,5 @@ !$acc host_data if(5) if_present !$acc host_data use_device(a, b, c) !$acc host_data use_device(a, b, c) if(5) if_present -!$acc host_data use_device(a, b, c, a, b, c, d) if(5) if_present +!$acc host_data use_device(a, b, c, d) if(5) if_present !$acc end host_data diff --git a/tests/builtin/reference/ref_kernels.txt b/tests/builtin/reference/ref_kernels.txt index 1d24460..cc50e51 100644 --- a/tests/builtin/reference/ref_kernels.txt +++ b/tests/builtin/reference/ref_kernels.txt @@ -25,17 +25,17 @@ #pragma acc kernels self(5) #pragma acc kernels self(x==3) #pragma acc kernels device_type(x, y, z) -#pragma acc kernels copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc kernels copyin(readonly: x, y, z, a, b, c) #pragma acc kernels copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc kernels copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc kernels copyin(readonly: x, y, z) copyin(a, b, c) #pragma acc kernels copyin(x, y, z, a, b, c) -#pragma acc kernels copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc kernels copyout(zero: x, y, z, a, b, c) #pragma acc kernels copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc kernels copyout(x, y, z) copyout(zero: a, b, c) #pragma acc kernels copyout(zero: x, y, z) copyout(a, b, c) #pragma acc kernels copyout(x, y, z, a, b, c) -#pragma acc kernels create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc kernels create(zero: x, y, z, a, b, c) #pragma acc kernels create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc kernels create(x, y, z) create(zero: a, b, c) #pragma acc kernels create(zero: x, y, z) create(a, b, c) diff --git a/tests/builtin/reference/ref_kernels_fortran.txt b/tests/builtin/reference/ref_kernels_fortran.txt index dfb088a..1d762e0 100644 --- a/tests/builtin/reference/ref_kernels_fortran.txt +++ b/tests/builtin/reference/ref_kernels_fortran.txt @@ -25,17 +25,17 @@ !$acc kernels self(5) !$acc kernels self(x==3) !$acc kernels device_type(x, y, z) -!$acc kernels copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc kernels copyin(readonly: x, y, z, a, b, c) !$acc kernels copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc kernels copyin(x, y, z) copyin(readonly: a, b, c) !$acc kernels copyin(readonly: x, y, z) copyin(a, b, c) !$acc kernels copyin(x, y, z, a, b, c) -!$acc kernels copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc kernels copyout(zero: x, y, z, a, b, c) !$acc kernels copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc kernels copyout(x, y, z) copyout(zero: a, b, c) !$acc kernels copyout(zero: x, y, z) copyout(a, b, c) !$acc kernels copyout(x, y, z, a, b, c) -!$acc kernels create(zero: x, y, z, x, y, a, a, b, c) +!$acc kernels create(zero: x, y, z, a, b, c) !$acc kernels create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc kernels create(x, y, z) create(zero: a, b, c) !$acc kernels create(zero: x, y, z) create(a, b, c) diff --git a/tests/builtin/reference/ref_kernels_loop.txt b/tests/builtin/reference/ref_kernels_loop.txt index d9ffb09..41a254b 100644 --- a/tests/builtin/reference/ref_kernels_loop.txt +++ b/tests/builtin/reference/ref_kernels_loop.txt @@ -25,17 +25,17 @@ #pragma acc kernels loop self(5) #pragma acc kernels loop self(x==3) #pragma acc kernels loop device_type(x, y, z) -#pragma acc kernels loop copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc kernels loop copyin(readonly: x, y, z, a, b, c) #pragma acc kernels loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc kernels loop copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc kernels loop copyin(readonly: x, y, z) copyin(a, b, c) #pragma acc kernels loop copyin(x, y, z, a, b, c) -#pragma acc kernels loop copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc kernels loop copyout(zero: x, y, z, a, b, c) #pragma acc kernels loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc kernels loop copyout(x, y, z) copyout(zero: a, b, c) #pragma acc kernels loop copyout(zero: x, y, z) copyout(a, b, c) #pragma acc kernels loop copyout(x, y, z, a, b, c) -#pragma acc kernels loop create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc kernels loop create(zero: x, y, z, a, b, c) #pragma acc kernels loop create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc kernels loop create(x, y, z) create(zero: a, b, c) #pragma acc kernels loop create(zero: x, y, z) create(a, b, c) @@ -87,14 +87,14 @@ #pragma acc kernels loop tile(1, 2) #pragma acc kernels loop tile(1, 1, 2) #pragma acc kernels loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) -#pragma acc kernels loop reduction(+ : x, y, z, x, y, a, a, b, c) +#pragma acc kernels loop reduction(+ : x, y, z, a, b, c) #pragma acc kernels loop reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc kernels loop reduction(max : x, y, z) reduction(min : a, b, c) #pragma acc kernels loop reduction(min : x, y, z, a, b, c) #pragma acc kernels loop reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc kernels loop reduction(|| : x, y, z) reduction(&& : a, b, c) #pragma acc kernels loop reduction(&& : x, y, z, a, b, c) -#pragma acc kernels loop reduction(max : x, y, max, x, y, min) +#pragma acc kernels loop reduction(max : x, y, max, min) #pragma acc kernels loop reduction(+ : x, y, z) #pragma acc kernels loop reduction(* : x, y, z) #pragma acc kernels loop reduction(max : x, y, z) diff --git a/tests/builtin/reference/ref_kernels_loop_fortran.txt b/tests/builtin/reference/ref_kernels_loop_fortran.txt index b15806f..39deb57 100644 --- a/tests/builtin/reference/ref_kernels_loop_fortran.txt +++ b/tests/builtin/reference/ref_kernels_loop_fortran.txt @@ -25,17 +25,17 @@ !$acc kernels loop self(5) !$acc kernels loop self(x==3) !$acc kernels loop device_type(x, y, z) -!$acc kernels loop copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc kernels loop copyin(readonly: x, y, z, a, b, c) !$acc kernels loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc kernels loop copyin(x, y, z) copyin(readonly: a, b, c) !$acc kernels loop copyin(readonly: x, y, z) copyin(a, b, c) !$acc kernels loop copyin(x, y, z, a, b, c) -!$acc kernels loop copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc kernels loop copyout(zero: x, y, z, a, b, c) !$acc kernels loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc kernels loop copyout(x, y, z) copyout(zero: a, b, c) !$acc kernels loop copyout(zero: x, y, z) copyout(a, b, c) !$acc kernels loop copyout(x, y, z, a, b, c) -!$acc kernels loop create(zero: x, y, z, x, y, a, a, b, c) +!$acc kernels loop create(zero: x, y, z, a, b, c) !$acc kernels loop create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc kernels loop create(x, y, z) create(zero: a, b, c) !$acc kernels loop create(zero: x, y, z) create(a, b, c) @@ -87,14 +87,14 @@ !$acc kernels loop tile(1, 2) !$acc kernels loop tile(1, 1, 2) !$acc kernels loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) -!$acc kernels loop reduction(+ : x, y, z, x, y, a, a, b, c) +!$acc kernels loop reduction(+ : x, y, z, a, b, c) !$acc kernels loop reduction(+ : x, y, z) reduction(* : a, b, c) !$acc kernels loop reduction(max : x, y, z) reduction(min : a, b, c) !$acc kernels loop reduction(min : x, y, z, a, b, c) !$acc kernels loop reduction(min : x, y, z) reduction(&& : a, b, c) !$acc kernels loop reduction(|| : x, y, z) reduction(&& : a, b, c) !$acc kernels loop reduction(&& : x, y, z, a, b, c) -!$acc kernels loop reduction(max : x, y, max, x, y, min) +!$acc kernels loop reduction(max : x, y, max, min) !$acc kernels loop reduction(+ : x, y, z) !$acc kernels loop reduction(* : x, y, z) !$acc kernels loop reduction(max : x, y, z) diff --git a/tests/builtin/reference/ref_loop.txt b/tests/builtin/reference/ref_loop.txt index 92f4dae..a4da729 100644 --- a/tests/builtin/reference/ref_loop.txt +++ b/tests/builtin/reference/ref_loop.txt @@ -30,14 +30,14 @@ #pragma acc loop tile(1, 2) #pragma acc loop tile(1, 1, 2) #pragma acc loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) -#pragma acc loop reduction(+ : x, y, z, x, y, a, a, b, c) +#pragma acc loop reduction(+ : x, y, z, a, b, c) #pragma acc loop reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc loop reduction(max : x, y, z) reduction(min : a, b, c) #pragma acc loop reduction(min : x, y, z, a, b, c) #pragma acc loop reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc loop reduction(|| : x, y, z) reduction(&& : a, b, c) #pragma acc loop reduction(&& : x, y, z, a, b, c) -#pragma acc loop reduction(max : x, y, max, x, y, min) +#pragma acc loop reduction(max : x, y, max, min) #pragma acc loop device_type(x, y, z) #pragma acc loop reduction(+ : x, y, z) #pragma acc loop reduction(* : x, y, z) diff --git a/tests/builtin/reference/ref_loop_fortran.txt b/tests/builtin/reference/ref_loop_fortran.txt index 4b5c69c..f5f2df7 100644 --- a/tests/builtin/reference/ref_loop_fortran.txt +++ b/tests/builtin/reference/ref_loop_fortran.txt @@ -30,14 +30,14 @@ !$acc loop tile(1, 2) !$acc loop tile(1, 1, 2) !$acc loop tile(1, 1, 2) worker(num: a) worker(num: 5) independent collapse(1) -!$acc loop reduction(+ : x, y, z, x, y, a, a, b, c) +!$acc loop reduction(+ : x, y, z, a, b, c) !$acc loop reduction(+ : x, y, z) reduction(* : a, b, c) !$acc loop reduction(max : x, y, z) reduction(min : a, b, c) !$acc loop reduction(min : x, y, z, a, b, c) !$acc loop reduction(min : x, y, z) reduction(&& : a, b, c) !$acc loop reduction(|| : x, y, z) reduction(&& : a, b, c) !$acc loop reduction(&& : x, y, z, a, b, c) -!$acc loop reduction(max : x, y, max, x, y, min) +!$acc loop reduction(max : x, y, max, min) !$acc loop device_type(x, y, z) !$acc loop reduction(+ : x, y, z) !$acc loop reduction(* : x, y, z) diff --git a/tests/builtin/reference/ref_parallel.txt b/tests/builtin/reference/ref_parallel.txt index 9585970..25941ce 100644 --- a/tests/builtin/reference/ref_parallel.txt +++ b/tests/builtin/reference/ref_parallel.txt @@ -44,29 +44,29 @@ #pragma acc parallel reduction(^ : x, y, z) #pragma acc parallel reduction(&& : x, y, z) #pragma acc parallel reduction(|| : x, y, z) -#pragma acc parallel copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc parallel copyin(readonly: x, y, z, a, b, c) #pragma acc parallel copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc parallel copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc parallel copyin(readonly: x, y, z) copyin(a, b, c) #pragma acc parallel copyin(x, y, z, a, b, c) -#pragma acc parallel copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc parallel copyout(zero: x, y, z, a, b, c) #pragma acc parallel copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc parallel copyout(x, y, z) copyout(zero: a, b, c) #pragma acc parallel copyout(zero: x, y, z) copyout(a, b, c) #pragma acc parallel copyout(x, y, z, a, b, c) -#pragma acc parallel create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc parallel create(zero: x, y, z, a, b, c) #pragma acc parallel create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc parallel create(x, y, z) create(zero: a, b, c) #pragma acc parallel create(zero: x, y, z) create(a, b, c) #pragma acc parallel create(x, y, z, a, b, c) -#pragma acc parallel reduction(+ : x, y, z, x, y, a, a, b, c) +#pragma acc parallel reduction(+ : x, y, z, a, b, c) #pragma acc parallel reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc parallel reduction(max : x, y, z) reduction(min : a, b, c) #pragma acc parallel reduction(min : x, y, z, a, b, c) #pragma acc parallel reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc parallel reduction(|| : x, y, z) reduction(&& : a, b, c) #pragma acc parallel reduction(&& : x, y, z, a, b, c) -#pragma acc parallel reduction(max : x, y, max, x, y, min) +#pragma acc parallel reduction(max : x, y, max, min) #pragma acc parallel copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) #pragma acc parallel async(expression1) async(expression2) async(expression3) #pragma acc parallel async(expression1) async(expression2) diff --git a/tests/builtin/reference/ref_parallel_fortran.txt b/tests/builtin/reference/ref_parallel_fortran.txt index d0ec1dc..ff86600 100644 --- a/tests/builtin/reference/ref_parallel_fortran.txt +++ b/tests/builtin/reference/ref_parallel_fortran.txt @@ -44,29 +44,29 @@ !$acc parallel reduction(^ : x, y, z) !$acc parallel reduction(&& : x, y, z) !$acc parallel reduction(|| : x, y, z) -!$acc parallel copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc parallel copyin(readonly: x, y, z, a, b, c) !$acc parallel copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc parallel copyin(x, y, z) copyin(readonly: a, b, c) !$acc parallel copyin(readonly: x, y, z) copyin(a, b, c) !$acc parallel copyin(x, y, z, a, b, c) -!$acc parallel copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc parallel copyout(zero: x, y, z, a, b, c) !$acc parallel copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc parallel copyout(x, y, z) copyout(zero: a, b, c) !$acc parallel copyout(zero: x, y, z) copyout(a, b, c) !$acc parallel copyout(x, y, z, a, b, c) -!$acc parallel create(zero: x, y, z, x, y, a, a, b, c) +!$acc parallel create(zero: x, y, z, a, b, c) !$acc parallel create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc parallel create(x, y, z) create(zero: a, b, c) !$acc parallel create(zero: x, y, z) create(a, b, c) !$acc parallel create(x, y, z, a, b, c) -!$acc parallel reduction(+ : x, y, z, x, y, a, a, b, c) +!$acc parallel reduction(+ : x, y, z, a, b, c) !$acc parallel reduction(+ : x, y, z) reduction(* : a, b, c) !$acc parallel reduction(max : x, y, z) reduction(min : a, b, c) !$acc parallel reduction(min : x, y, z, a, b, c) !$acc parallel reduction(min : x, y, z) reduction(&& : a, b, c) !$acc parallel reduction(|| : x, y, z) reduction(&& : a, b, c) !$acc parallel reduction(&& : x, y, z, a, b, c) -!$acc parallel reduction(max : x, y, max, x, y, min) +!$acc parallel reduction(max : x, y, max, min) !$acc parallel copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) !$acc parallel async(expression1) async(expression2) async(expression3) !$acc parallel async(expression1) async(expression2) diff --git a/tests/builtin/reference/ref_parallel_loop.txt b/tests/builtin/reference/ref_parallel_loop.txt index 7dd74c8..b8abe4f 100644 --- a/tests/builtin/reference/ref_parallel_loop.txt +++ b/tests/builtin/reference/ref_parallel_loop.txt @@ -47,29 +47,29 @@ #pragma acc parallel loop reduction(^ : x, y, z) #pragma acc parallel loop reduction(&& : x, y, z) #pragma acc parallel loop reduction(|| : x, y, z) -#pragma acc parallel loop copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc parallel loop copyin(readonly: x, y, z, a, b, c) #pragma acc parallel loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc parallel loop copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc parallel loop copyin(readonly: x, y, z) copyin(a, b, c) #pragma acc parallel loop copyin(x, y, z, a, b, c) -#pragma acc parallel loop copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc parallel loop copyout(zero: x, y, z, a, b, c) #pragma acc parallel loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc parallel loop copyout(x, y, z) copyout(zero: a, b, c) #pragma acc parallel loop copyout(zero: x, y, z) copyout(a, b, c) #pragma acc parallel loop copyout(x, y, z, a, b, c) -#pragma acc parallel loop create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc parallel loop create(zero: x, y, z, a, b, c) #pragma acc parallel loop create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc parallel loop create(x, y, z) create(zero: a, b, c) #pragma acc parallel loop create(zero: x, y, z) create(a, b, c) #pragma acc parallel loop create(x, y, z, a, b, c) -#pragma acc parallel loop reduction(+ : x, y, z, x, y, a, a, b, c) +#pragma acc parallel loop reduction(+ : x, y, z, a, b, c) #pragma acc parallel loop reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc parallel loop reduction(max : x, y, z) reduction(min : a, b, c) #pragma acc parallel loop reduction(min : x, y, z, a, b, c) #pragma acc parallel loop reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc parallel loop reduction(|| : x, y, z) reduction(&& : a, b, c) #pragma acc parallel loop reduction(&& : x, y, z, a, b, c) -#pragma acc parallel loop reduction(max : x, y, max, x, y, min) +#pragma acc parallel loop reduction(max : x, y, max, min) #pragma acc parallel loop copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) #pragma acc parallel loop async(expression1) async(expression2) async(expression3) #pragma acc parallel loop async(expression1) async(expression2) diff --git a/tests/builtin/reference/ref_parallel_loop_fortran.txt b/tests/builtin/reference/ref_parallel_loop_fortran.txt index 9526ba9..eb97c4c 100644 --- a/tests/builtin/reference/ref_parallel_loop_fortran.txt +++ b/tests/builtin/reference/ref_parallel_loop_fortran.txt @@ -47,29 +47,29 @@ !$acc parallel loop reduction(^ : x, y, z) !$acc parallel loop reduction(&& : x, y, z) !$acc parallel loop reduction(|| : x, y, z) -!$acc parallel loop copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc parallel loop copyin(readonly: x, y, z, a, b, c) !$acc parallel loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc parallel loop copyin(x, y, z) copyin(readonly: a, b, c) !$acc parallel loop copyin(readonly: x, y, z) copyin(a, b, c) !$acc parallel loop copyin(x, y, z, a, b, c) -!$acc parallel loop copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc parallel loop copyout(zero: x, y, z, a, b, c) !$acc parallel loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc parallel loop copyout(x, y, z) copyout(zero: a, b, c) !$acc parallel loop copyout(zero: x, y, z) copyout(a, b, c) !$acc parallel loop copyout(x, y, z, a, b, c) -!$acc parallel loop create(zero: x, y, z, x, y, a, a, b, c) +!$acc parallel loop create(zero: x, y, z, a, b, c) !$acc parallel loop create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc parallel loop create(x, y, z) create(zero: a, b, c) !$acc parallel loop create(zero: x, y, z) create(a, b, c) !$acc parallel loop create(x, y, z, a, b, c) -!$acc parallel loop reduction(+ : x, y, z, x, y, a, a, b, c) +!$acc parallel loop reduction(+ : x, y, z, a, b, c) !$acc parallel loop reduction(+ : x, y, z) reduction(* : a, b, c) !$acc parallel loop reduction(max : x, y, z) reduction(min : a, b, c) !$acc parallel loop reduction(min : x, y, z, a, b, c) !$acc parallel loop reduction(min : x, y, z) reduction(&& : a, b, c) !$acc parallel loop reduction(|| : x, y, z) reduction(&& : a, b, c) !$acc parallel loop reduction(&& : x, y, z, a, b, c) -!$acc parallel loop reduction(max : x, y, max, x, y, min) +!$acc parallel loop reduction(max : x, y, max, min) !$acc parallel loop copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) !$acc parallel loop async(expression1) async(expression2) async(expression3) !$acc parallel loop async(expression1) async(expression2) diff --git a/tests/builtin/reference/ref_serial.txt b/tests/builtin/reference/ref_serial.txt index f27a357..20665e0 100644 --- a/tests/builtin/reference/ref_serial.txt +++ b/tests/builtin/reference/ref_serial.txt @@ -41,29 +41,29 @@ #pragma acc serial reduction(^ : x, y, z) #pragma acc serial reduction(&& : x, y, z) #pragma acc serial reduction(|| : x, y, z) -#pragma acc serial copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc serial copyin(readonly: x, y, z, a, b, c) #pragma acc serial copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc serial copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc serial copyin(readonly: x, y, z) copyin(a, b, c) #pragma acc serial copyin(x, y, z, a, b, c) -#pragma acc serial copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc serial copyout(zero: x, y, z, a, b, c) #pragma acc serial copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc serial copyout(x, y, z) copyout(zero: a, b, c) #pragma acc serial copyout(zero: x, y, z) copyout(a, b, c) #pragma acc serial copyout(x, y, z, a, b, c) -#pragma acc serial create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc serial create(zero: x, y, z, a, b, c) #pragma acc serial create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc serial create(x, y, z) create(zero: a, b, c) #pragma acc serial create(zero: x, y, z) create(a, b, c) #pragma acc serial create(x, y, z, a, b, c) -#pragma acc serial reduction(+ : x, y, z, x, y, a, a, b, c) +#pragma acc serial reduction(+ : x, y, z, a, b, c) #pragma acc serial reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc serial reduction(max : x, y, z) reduction(min : a, b, c) #pragma acc serial reduction(min : x, y, z, a, b, c) #pragma acc serial reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc serial reduction(|| : x, y, z) reduction(&& : a, b, c) #pragma acc serial reduction(&& : x, y, z, a, b, c) -#pragma acc serial reduction(max : x, y, max, x, y, min) +#pragma acc serial reduction(max : x, y, max, min) #pragma acc serial copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) #pragma acc serial async(expression1) async(expression2) async(expression3) #pragma acc serial async(expression1) async(expression2) diff --git a/tests/builtin/reference/ref_serial_fortran.txt b/tests/builtin/reference/ref_serial_fortran.txt index 9039cd6..4b34d97 100644 --- a/tests/builtin/reference/ref_serial_fortran.txt +++ b/tests/builtin/reference/ref_serial_fortran.txt @@ -41,29 +41,29 @@ !$acc serial reduction(^ : x, y, z) !$acc serial reduction(&& : x, y, z) !$acc serial reduction(|| : x, y, z) -!$acc serial copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc serial copyin(readonly: x, y, z, a, b, c) !$acc serial copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc serial copyin(x, y, z) copyin(readonly: a, b, c) !$acc serial copyin(readonly: x, y, z) copyin(a, b, c) !$acc serial copyin(x, y, z, a, b, c) -!$acc serial copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc serial copyout(zero: x, y, z, a, b, c) !$acc serial copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc serial copyout(x, y, z) copyout(zero: a, b, c) !$acc serial copyout(zero: x, y, z) copyout(a, b, c) !$acc serial copyout(x, y, z, a, b, c) -!$acc serial create(zero: x, y, z, x, y, a, a, b, c) +!$acc serial create(zero: x, y, z, a, b, c) !$acc serial create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc serial create(x, y, z) create(zero: a, b, c) !$acc serial create(zero: x, y, z) create(a, b, c) !$acc serial create(x, y, z, a, b, c) -!$acc serial reduction(+ : x, y, z, x, y, a, a, b, c) +!$acc serial reduction(+ : x, y, z, a, b, c) !$acc serial reduction(+ : x, y, z) reduction(* : a, b, c) !$acc serial reduction(max : x, y, z) reduction(min : a, b, c) !$acc serial reduction(min : x, y, z, a, b, c) !$acc serial reduction(min : x, y, z) reduction(&& : a, b, c) !$acc serial reduction(|| : x, y, z) reduction(&& : a, b, c) !$acc serial reduction(&& : x, y, z, a, b, c) -!$acc serial reduction(max : x, y, max, x, y, min) +!$acc serial reduction(max : x, y, max, min) !$acc serial copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) !$acc serial async(expression1) async(expression2) async(expression3) !$acc serial async(expression1) async(expression2) diff --git a/tests/builtin/reference/ref_serial_loop.txt b/tests/builtin/reference/ref_serial_loop.txt index 5ab3970..cb8a2e7 100644 --- a/tests/builtin/reference/ref_serial_loop.txt +++ b/tests/builtin/reference/ref_serial_loop.txt @@ -41,29 +41,29 @@ #pragma acc serial loop reduction(^ : x, y, z) #pragma acc serial loop reduction(&& : x, y, z) #pragma acc serial loop reduction(|| : x, y, z) -#pragma acc serial loop copyin(readonly: x, y, z, x, y, a, a, b, c) +#pragma acc serial loop copyin(readonly: x, y, z, a, b, c) #pragma acc serial loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) #pragma acc serial loop copyin(x, y, z) copyin(readonly: a, b, c) #pragma acc serial loop copyin(readonly: x, y, z) copyin(a, b, c) #pragma acc serial loop copyin(x, y, z, a, b, c) -#pragma acc serial loop copyout(zero: x, y, z, x, y, a, a, b, c) +#pragma acc serial loop copyout(zero: x, y, z, a, b, c) #pragma acc serial loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc serial loop copyout(x, y, z) copyout(zero: a, b, c) #pragma acc serial loop copyout(zero: x, y, z) copyout(a, b, c) #pragma acc serial loop copyout(x, y, z, a, b, c) -#pragma acc serial loop create(zero: x, y, z, x, y, a, a, b, c) +#pragma acc serial loop create(zero: x, y, z, a, b, c) #pragma acc serial loop create(zero: x, y, z, a, b, c, 1, 2, 3) #pragma acc serial loop create(x, y, z) create(zero: a, b, c) #pragma acc serial loop create(zero: x, y, z) create(a, b, c) #pragma acc serial loop create(x, y, z, a, b, c) -#pragma acc serial loop reduction(+ : x, y, z, x, y, a, a, b, c) +#pragma acc serial loop reduction(+ : x, y, z, a, b, c) #pragma acc serial loop reduction(+ : x, y, z) reduction(* : a, b, c) #pragma acc serial loop reduction(max : x, y, z) reduction(min : a, b, c) #pragma acc serial loop reduction(min : x, y, z, a, b, c) #pragma acc serial loop reduction(min : x, y, z) reduction(&& : a, b, c) #pragma acc serial loop reduction(|| : x, y, z) reduction(&& : a, b, c) #pragma acc serial loop reduction(&& : x, y, z, a, b, c) -#pragma acc serial loop reduction(max : x, y, max, x, y, min) +#pragma acc serial loop reduction(max : x, y, max, min) #pragma acc serial loop copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) #pragma acc serial loop async(expression1) async(expression2) async(expression3) #pragma acc serial loop async(expression1) async(expression2) diff --git a/tests/builtin/reference/ref_serial_loop_fortran.txt b/tests/builtin/reference/ref_serial_loop_fortran.txt index 189b978..8d5fb4f 100644 --- a/tests/builtin/reference/ref_serial_loop_fortran.txt +++ b/tests/builtin/reference/ref_serial_loop_fortran.txt @@ -41,29 +41,29 @@ !$acc serial loop reduction(^ : x, y, z) !$acc serial loop reduction(&& : x, y, z) !$acc serial loop reduction(|| : x, y, z) -!$acc serial loop copyin(readonly: x, y, z, x, y, a, a, b, c) +!$acc serial loop copyin(readonly: x, y, z, a, b, c) !$acc serial loop copyin(readonly: x, y, z, a, b, c, 1, 2, 3) !$acc serial loop copyin(x, y, z) copyin(readonly: a, b, c) !$acc serial loop copyin(readonly: x, y, z) copyin(a, b, c) !$acc serial loop copyin(x, y, z, a, b, c) -!$acc serial loop copyout(zero: x, y, z, x, y, a, a, b, c) +!$acc serial loop copyout(zero: x, y, z, a, b, c) !$acc serial loop copyout(zero: x, y, z, a, b, c, 1, 2, 3) !$acc serial loop copyout(x, y, z) copyout(zero: a, b, c) !$acc serial loop copyout(zero: x, y, z) copyout(a, b, c) !$acc serial loop copyout(x, y, z, a, b, c) -!$acc serial loop create(zero: x, y, z, x, y, a, a, b, c) +!$acc serial loop create(zero: x, y, z, a, b, c) !$acc serial loop create(zero: x, y, z, a, b, c, 1, 2, 3) !$acc serial loop create(x, y, z) create(zero: a, b, c) !$acc serial loop create(zero: x, y, z) create(a, b, c) !$acc serial loop create(x, y, z, a, b, c) -!$acc serial loop reduction(+ : x, y, z, x, y, a, a, b, c) +!$acc serial loop reduction(+ : x, y, z, a, b, c) !$acc serial loop reduction(+ : x, y, z) reduction(* : a, b, c) !$acc serial loop reduction(max : x, y, z) reduction(min : a, b, c) !$acc serial loop reduction(min : x, y, z, a, b, c) !$acc serial loop reduction(min : x, y, z) reduction(&& : a, b, c) !$acc serial loop reduction(|| : x, y, z) reduction(&& : a, b, c) !$acc serial loop reduction(&& : x, y, z, a, b, c) -!$acc serial loop reduction(max : x, y, max, x, y, min) +!$acc serial loop reduction(max : x, y, max, min) !$acc serial loop copyin(readonly: x, y, z) copyout(zero: x, y, z) create(zero: x, y, z) reduction(+ : x, y, z) !$acc serial loop async(expression1) async(expression2) async(expression3) !$acc serial loop async(expression1) async(expression2) diff --git a/tests/builtin/reference/ref_update.txt b/tests/builtin/reference/ref_update.txt index f805cea..b032239 100644 --- a/tests/builtin/reference/ref_update.txt +++ b/tests/builtin/reference/ref_update.txt @@ -18,6 +18,6 @@ #pragma acc update if(5) #pragma acc update if(x==3) #pragma acc update host(x, y) -#pragma acc update device(x, y, x, y) -#pragma acc update device(x, y, x, y, x, y) -#pragma acc update self(x, y, x, y, x, y, z) +#pragma acc update device(x, y) +#pragma acc update device(x, y) +#pragma acc update self(x, y, z) diff --git a/tests/builtin/reference/ref_update_fortran.txt b/tests/builtin/reference/ref_update_fortran.txt index 0137ce7..e10169e 100644 --- a/tests/builtin/reference/ref_update_fortran.txt +++ b/tests/builtin/reference/ref_update_fortran.txt @@ -18,6 +18,6 @@ !$acc update if(5) !$acc update if(x==3) !$acc update host(x, y) -!$acc update device(x, y, x, y) -!$acc update device(x, y, x, y, x, y) -!$acc update self(x, y, x, y, x, y, z) +!$acc update device(x, y) +!$acc update device(x, y) +!$acc update self(x, y, z) From c97dd9fcd0b350ff0c32091335b20d62c0aa9d75 Mon Sep 17 00:00:00 2001 From: Anjia Wang Date: Mon, 24 Nov 2025 06:03:23 +0000 Subject: [PATCH 6/6] Dedup var list entries when clause merging is enabled --- src/OpenACCIR.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenACCIR.h b/src/OpenACCIR.h index c6b851d..4d0026c 100644 --- a/src/OpenACCIR.h +++ b/src/OpenACCIR.h @@ -117,7 +117,7 @@ class OpenACCVarListClause : public OpenACCClause { void addVar(const std::string &expr, OpenACCClauseSeparator sep = ACCC_CLAUSE_SEP_comma) { - vars.push_back(OpenACCExpressionItem{expr, sep}); + addVar(OpenACCExpressionItem{expr, sep}); } void addVar(const OpenACCExpressionItem &item) { if (isClauseMergingEnabled()) {