From b695de7eaf5375a7ed5625d0c60e2a293f71e6bf Mon Sep 17 00:00:00 2001 From: Artem Gindinson Date: Fri, 23 Oct 2020 17:35:58 +0300 Subject: [PATCH 1/5] [NFC][SYCL] Clean up FPGA archive files after test runs In some local configurations, re-launching fpga_aocx*.cpp tests appends new objects to the archive created during preceding test runs. Overwrite the archive files in a separate `RUN` line to avoid misleading failures in local development environments. Signed-off-by: Artem Gindinson --- sycl/test/fpga_tests/fpga_aocx.cpp | 4 +++- sycl/test/fpga_tests/fpga_aocx_win.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sycl/test/fpga_tests/fpga_aocx.cpp b/sycl/test/fpga_tests/fpga_aocx.cpp index a847329fea83..44621c876569 100644 --- a/sycl/test/fpga_tests/fpga_aocx.cpp +++ b/sycl/test/fpga_tests/fpga_aocx.cpp @@ -9,7 +9,9 @@ // REQUIRES: aoc, accelerator /// E2E test for AOCX creation/use/run for FPGA -// Produce an archive with device (AOCX) image +// Produce an archive with device (AOCX) image. Pre-create a file to avoid appending objects to +// leftover archives. +// RUN: touch %t_image.a // RUN: %clangxx -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.a // Produce a host object // RUN: %clangxx -fsycl -fintelfpga %S/Inputs/fpga_host.cpp -c -o %t.o diff --git a/sycl/test/fpga_tests/fpga_aocx_win.cpp b/sycl/test/fpga_tests/fpga_aocx_win.cpp index 675cebebcd08..be25db73af68 100644 --- a/sycl/test/fpga_tests/fpga_aocx_win.cpp +++ b/sycl/test/fpga_tests/fpga_aocx_win.cpp @@ -10,7 +10,9 @@ // REQUIRES: system-windows /// E2E test for AOCX creation/use/run for FPGA -// Produce an archive with device (AOCX) image +// Produce an archive with device (AOCX) image. Pre-create a file to avoid appending objects to +// leftover archives. +// RUN: touch %t_image.lib // RUN: %clang_cl -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.lib // Produce a host object // RUN: %clang_cl -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp -c -o %t.obj From d2ca8147454748e2912bf7e705e965e52b377613 Mon Sep 17 00:00:00 2001 From: Artem Gindinson Date: Fri, 23 Oct 2020 20:05:30 +0300 Subject: [PATCH 2/5] [NFC] Clang-format Signed-off-by: Artem Gindinson --- sycl/test/fpga_tests/fpga_aocx.cpp | 4 ++-- sycl/test/fpga_tests/fpga_aocx_win.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sycl/test/fpga_tests/fpga_aocx.cpp b/sycl/test/fpga_tests/fpga_aocx.cpp index 44621c876569..887cc704cb95 100644 --- a/sycl/test/fpga_tests/fpga_aocx.cpp +++ b/sycl/test/fpga_tests/fpga_aocx.cpp @@ -9,8 +9,8 @@ // REQUIRES: aoc, accelerator /// E2E test for AOCX creation/use/run for FPGA -// Produce an archive with device (AOCX) image. Pre-create a file to avoid appending objects to -// leftover archives. +// Produce an archive with device (AOCX) image. Pre-create a file to avoid +// appending objects to leftover archives. // RUN: touch %t_image.a // RUN: %clangxx -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.a // Produce a host object diff --git a/sycl/test/fpga_tests/fpga_aocx_win.cpp b/sycl/test/fpga_tests/fpga_aocx_win.cpp index be25db73af68..a4b71190a992 100644 --- a/sycl/test/fpga_tests/fpga_aocx_win.cpp +++ b/sycl/test/fpga_tests/fpga_aocx_win.cpp @@ -10,8 +10,8 @@ // REQUIRES: system-windows /// E2E test for AOCX creation/use/run for FPGA -// Produce an archive with device (AOCX) image. Pre-create a file to avoid appending objects to -// leftover archives. +// Produce an archive with device (AOCX) image. Pre-create a file to avoid +// appending objects to leftover archives. // RUN: touch %t_image.lib // RUN: %clang_cl -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.lib // Produce a host object From 941a40e7efa4b9bae2722636ae5c668d3363ac12 Mon Sep 17 00:00:00 2001 From: Artem Gindinson Date: Mon, 26 Oct 2020 06:15:12 +0300 Subject: [PATCH 3/5] Replace `touch` with a conditional removal Signed-off-by: Artem Gindinson --- sycl/test/fpga_tests/fpga_aocx.cpp | 2 +- sycl/test/fpga_tests/fpga_aocx_win.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/test/fpga_tests/fpga_aocx.cpp b/sycl/test/fpga_tests/fpga_aocx.cpp index 887cc704cb95..c1816c313f7e 100644 --- a/sycl/test/fpga_tests/fpga_aocx.cpp +++ b/sycl/test/fpga_tests/fpga_aocx.cpp @@ -11,7 +11,7 @@ /// E2E test for AOCX creation/use/run for FPGA // Produce an archive with device (AOCX) image. Pre-create a file to avoid // appending objects to leftover archives. -// RUN: touch %t_image.a +// RUN: if [ -f %t_image.a ]; then rm %t_image.a; fi // RUN: %clangxx -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.a // Produce a host object // RUN: %clangxx -fsycl -fintelfpga %S/Inputs/fpga_host.cpp -c -o %t.o diff --git a/sycl/test/fpga_tests/fpga_aocx_win.cpp b/sycl/test/fpga_tests/fpga_aocx_win.cpp index a4b71190a992..2357783d8b4d 100644 --- a/sycl/test/fpga_tests/fpga_aocx_win.cpp +++ b/sycl/test/fpga_tests/fpga_aocx_win.cpp @@ -12,7 +12,7 @@ /// E2E test for AOCX creation/use/run for FPGA // Produce an archive with device (AOCX) image. Pre-create a file to avoid // appending objects to leftover archives. -// RUN: touch %t_image.lib +// RUN: if [ -f %t_image.a ]; then rm %t_image.a; fi // RUN: %clang_cl -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.lib // Produce a host object // RUN: %clang_cl -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp -c -o %t.obj From 6db9a20b2b0a2883d71bccd7d16f5b8e0428644c Mon Sep 17 00:00:00 2001 From: Artem Gindinson Date: Mon, 26 Oct 2020 06:23:20 +0300 Subject: [PATCH 4/5] Adjust the comment as well Signed-off-by: Artem Gindinson --- sycl/test/fpga_tests/fpga_aocx.cpp | 4 ++-- sycl/test/fpga_tests/fpga_aocx_win.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sycl/test/fpga_tests/fpga_aocx.cpp b/sycl/test/fpga_tests/fpga_aocx.cpp index c1816c313f7e..f371201ed26d 100644 --- a/sycl/test/fpga_tests/fpga_aocx.cpp +++ b/sycl/test/fpga_tests/fpga_aocx.cpp @@ -9,8 +9,8 @@ // REQUIRES: aoc, accelerator /// E2E test for AOCX creation/use/run for FPGA -// Produce an archive with device (AOCX) image. Pre-create a file to avoid -// appending objects to leftover archives. +// Produce an archive with device (AOCX) image. Avoid appending objects to +// leftover archives. // RUN: if [ -f %t_image.a ]; then rm %t_image.a; fi // RUN: %clangxx -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.a // Produce a host object diff --git a/sycl/test/fpga_tests/fpga_aocx_win.cpp b/sycl/test/fpga_tests/fpga_aocx_win.cpp index 2357783d8b4d..99d672437d53 100644 --- a/sycl/test/fpga_tests/fpga_aocx_win.cpp +++ b/sycl/test/fpga_tests/fpga_aocx_win.cpp @@ -10,8 +10,8 @@ // REQUIRES: system-windows /// E2E test for AOCX creation/use/run for FPGA -// Produce an archive with device (AOCX) image. Pre-create a file to avoid -// appending objects to leftover archives. +// Produce an archive with device (AOCX) image. Avoid appending objects to +// leftover archives. // RUN: if [ -f %t_image.a ]; then rm %t_image.a; fi // RUN: %clang_cl -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.lib // Produce a host object From 7ef694a569d4abe764e3a8fbe1ba992e3f37ad7c Mon Sep 17 00:00:00 2001 From: Artem Gindinson Date: Mon, 26 Oct 2020 10:43:59 +0300 Subject: [PATCH 5/5] Another attempt... Signed-off-by: Artem Gindinson --- sycl/test/fpga_tests/fpga_aocx.cpp | 6 +++--- sycl/test/fpga_tests/fpga_aocx_win.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sycl/test/fpga_tests/fpga_aocx.cpp b/sycl/test/fpga_tests/fpga_aocx.cpp index f371201ed26d..af5de51a2a27 100644 --- a/sycl/test/fpga_tests/fpga_aocx.cpp +++ b/sycl/test/fpga_tests/fpga_aocx.cpp @@ -9,9 +9,9 @@ // REQUIRES: aoc, accelerator /// E2E test for AOCX creation/use/run for FPGA -// Produce an archive with device (AOCX) image. Avoid appending objects to -// leftover archives. -// RUN: if [ -f %t_image.a ]; then rm %t_image.a; fi +// Produce an archive with device (AOCX) image. To avoid appending objects to +// leftover archives, remove one if exists. +// RUN: rm %t_image.a || true // RUN: %clangxx -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.a // Produce a host object // RUN: %clangxx -fsycl -fintelfpga %S/Inputs/fpga_host.cpp -c -o %t.o diff --git a/sycl/test/fpga_tests/fpga_aocx_win.cpp b/sycl/test/fpga_tests/fpga_aocx_win.cpp index 99d672437d53..a0113ccf78a9 100644 --- a/sycl/test/fpga_tests/fpga_aocx_win.cpp +++ b/sycl/test/fpga_tests/fpga_aocx_win.cpp @@ -10,9 +10,9 @@ // REQUIRES: system-windows /// E2E test for AOCX creation/use/run for FPGA -// Produce an archive with device (AOCX) image. Avoid appending objects to -// leftover archives. -// RUN: if [ -f %t_image.a ]; then rm %t_image.a; fi +// Produce an archive with device (AOCX) image. To avoid appending objects to +// leftover archives, remove one if exists. +// RUN: rm %t_image.a || true // RUN: %clang_cl -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.lib // Produce a host object // RUN: %clang_cl -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp -c -o %t.obj