Skip to content

[SYCL] Enable swizzle_op and kernel_functor tests on non host devices. #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 19, 2019
Merged
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
8 changes: 4 additions & 4 deletions sycl/test/basic_tests/swizzle_op.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// RUN: %clang -std=c++11 -fsycl %s -o %t.out -lstdc++ -lOpenCL -lsycl
// RUN: %clang -std=c++11 -fsycl %s -o %t.out -lstdc++ -lOpenCL
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
// RUNx: %CPU_RUN_PLACEHOLDER %t.out
// RUNx: %GPU_RUN_PLACEHOLDER %t.out
// RUNx: %ACC_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out
//==------------ swizzle_op.cpp - SYCL SwizzleOp basic test ----------------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
Expand Down
24 changes: 9 additions & 15 deletions sycl/test/functor/kernel_functor.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// RUN: %clang -fsycl -o %t.out %s -lstdc++ -lOpenCL -lsycl
// RUN: %clang -fsycl -o %t.out %s -lstdc++ -lOpenCL
// RUN: cd %T
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out | FileCheck %s
// RUNx: %CPU_RUN_PLACEHOLDER %t.out
// RUNx: %GPU_RUN_PLACEHOLDER %t.out
// CHECK:Passed.
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out

//==--- kernel_functor.cpp - Functors as SYCL kernel test ------------------==//
//
Expand All @@ -14,7 +13,8 @@
//===----------------------------------------------------------------------===//

#include <CL/sycl.hpp>
#include <iostream>

#include <cassert>

constexpr auto sycl_read_write = cl::sycl::access::mode::read_write;
constexpr auto sycl_global_buffer = cl::sycl::access::target::global_buffer;
Expand Down Expand Up @@ -172,14 +172,8 @@ int main() {
const int Gold1 = 40;
const int Gold2 = 80;

if (Res1 != Gold1) {
std::cout << "FAILED. " << Res1 << "!=" << Gold1 << "\n";
return 1;
}
if (Res2 != Gold2) {
std::cout << "FAILED. " << Res2 << "!=" << Gold2 << "\n";
return 1;
}
std::cout << "Passed.\n";
assert(Res1 == Gold1);
assert(Res2 == Gold2);

return 0;
}