Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions test/smoke-fails/selfmap/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
include ../../Makefile.defs

TESTNAME = selfmap
TESTSRC_MAIN = selfmap.cpp
TESTSRC_AUX =
TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX)

RUNCMD_COPY = HSA_XNACK=0 ./$(TESTNAME)
RUNCMD_AUTOZERO = HSA_XNACK=1 ./$(TESTNAME)


CLANG = clang++
OMP_BIN = $(AOMP)/bin/$(CLANG)
CC = $(OMP_BIN) $(VERBOSE)
#-ccc-print-phases
#"-\#\#\#"

include ../Makefile.rules

run: $(TESTNAME)
$(RUNCMD_COPY)
$(RUNCMD_AUTOZERO)
24 changes: 24 additions & 0 deletions test/smoke-fails/selfmap/selfmap.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <cstring>
#include <stdio.h>

#define N 100

int main() {
int x = 0;

#pragma omp target teams distribute parallel for map(self : x)
{
for (unsigned i = 0; i < N; ++i)
#pragma omp atomic update
x++;
}

#pragma omp target teams distribute parallel for map(self, tofrom : x)
{
for (unsigned i = 0; i < N; ++i)
#pragma omp atomic update
x++;
}

return 0;
}
22 changes: 22 additions & 0 deletions test/smoke-fails/selfmap_map_mixed/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
include ../../Makefile.defs

TESTNAME = selfmap_map_mixed
TESTSRC_MAIN = selfmap_map_mixed.cpp
TESTSRC_AUX =
TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX)

RUNCMD_COPY = HSA_XNACK=0 ./$(TESTNAME)
RUNCMD_AUTOZERO = HSA_XNACK=1 ./$(TESTNAME)


CLANG = clang++
OMP_BIN = $(AOMP)/bin/$(CLANG)
CC = $(OMP_BIN) $(VERBOSE)
#-ccc-print-phases
#"-\#\#\#"

include ../Makefile.rules

run: $(TESTNAME)
$(RUNCMD_COPY)
$(RUNCMD_AUTOZERO)
13 changes: 13 additions & 0 deletions test/smoke-fails/selfmap_map_mixed/selfmap_map_mixed.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
int main() {
int x = 0;
#pragma omp target data map(self : x)
{
#pragma omp target map(x)
{
// unspecified behaviour. It is not clear what x is used. Maybe a warning should
// be issued to inform the programmer.
#pragma omp atomic update
x++;
}
}
}