Skip to content

[SYCL][NFC] Cover more classes with ABI tests #2577

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 1 commit into from
Oct 1, 2020
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
84 changes: 84 additions & 0 deletions sycl/test/abi/layout_array.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s
// REQUIRES: linux

// clang-format off

// TODO fix individual headers and include them instead of sycl.hpp
#include <CL/sycl.hpp>


void range(sycl::range<2>) {}

// CHECK: 0 | class cl::sycl::range<2>
// CHECK-NEXT: 0 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 0 | size_t [2] common_array
// CHECK-NEXT: | [sizeof=16, dsize=16, align=8,
// CHECK-NEXT: | nvsize=16, nvalign=8]

//----------------------------

void id(sycl::id<2>) {}

// CHECK: 0 | class cl::sycl::id<3>
// CHECK-NEXT: 0 | class cl::sycl::detail::array<3> (base)
// CHECK-NEXT: 0 | size_t [3] common_array
// CHECK-NEXT: | [sizeof=24, dsize=24, align=8,
// CHECK-NEXT: | nvsize=24, nvalign=8]

//----------------------------

void item(sycl::item<2>) {}

// CHECK: 0 | class cl::sycl::item<2, true>
// CHECK-NEXT: 0 | struct cl::sycl::detail::ItemBase<2, true> MImpl
// CHECK-NEXT: 0 | class cl::sycl::range<2> MExtent
// CHECK-NEXT: 0 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 0 | size_t [2] common_array
// CHECK-NEXT: 16 | class cl::sycl::id<2> MIndex
// CHECK-NEXT: 16 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 16 | size_t [2] common_array
// CHECK-NEXT: 32 | class cl::sycl::id<2> MOffset
// CHECK-NEXT: 32 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 32 | size_t [2] common_array
// CHECK-NEXT: | [sizeof=48, dsize=48, align=8,
// CHECK-NEXT: | nvsize=48, nvalign=8]

//----------------------------

void nd_item(sycl::nd_item<2>) {}

// CHECK: 0 | class cl::sycl::nd_item<2>
// CHECK-NEXT: 0 | class cl::sycl::item<2, true> globalItem
// CHECK-NEXT: 0 | struct cl::sycl::detail::ItemBase<2, true> MImpl
// CHECK-NEXT: 0 | class cl::sycl::range<2> MExtent
// CHECK-NEXT: 0 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 0 | size_t [2] common_array
// CHECK-NEXT: 16 | class cl::sycl::id<2> MIndex
// CHECK-NEXT: 16 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 16 | size_t [2] common_array
// CHECK-NEXT: 32 | class cl::sycl::id<2> MOffset
// CHECK-NEXT: 32 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 32 | size_t [2] common_array
// CHECK-NEXT: 48 | class cl::sycl::item<2, false> localItem
// CHECK-NEXT: 48 | struct cl::sycl::detail::ItemBase<2, false> MImpl
// CHECK-NEXT: 48 | class cl::sycl::range<2> MExtent
// CHECK-NEXT: 48 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 48 | size_t [2] common_array
// CHECK-NEXT: 64 | class cl::sycl::id<2> MIndex
// CHECK-NEXT: 64 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 64 | size_t [2] common_array
// CHECK-NEXT: 80 | class cl::sycl::group<2> Group
// CHECK-NEXT: 80 | class cl::sycl::range<2> globalRange
// CHECK-NEXT: 80 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 80 | size_t [2] common_array
// CHECK-NEXT: 96 | class cl::sycl::range<2> localRange
// CHECK-NEXT: 96 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 96 | size_t [2] common_array
// CHECK-NEXT: 112 | class cl::sycl::range<2> groupRange
// CHECK-NEXT: 112 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 112 | size_t [2] common_array
// CHECK-NEXT: 128 | class cl::sycl::id<2> index
// CHECK-NEXT: 128 | class cl::sycl::detail::array<2> (base)
// CHECK-NEXT: 128 | size_t [2] common_array
// CHECK-NEXT: | [sizeof=144, dsize=144, align=8,
// CHECK-NEXT: | nvsize=144, nvalign=8]
22 changes: 22 additions & 0 deletions sycl/test/abi/layout_vec.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s
// REQUIRES: linux

// clang-format off

#include <CL/sycl/types.hpp>

void foo(sycl::vec<int, 4>) {}

// CHECK: 0 | class cl::sycl::vec<int, 4>
// CHECK-NEXT: 0 | cl::sycl::vec<int, 4>::DataType m_Data
// CHECK-NEXT: | [sizeof=16, dsize=16, align=16,
// CHECK-NEXT: | nvsize=16, nvalign=16]

//--------------------------------------

void foo(sycl::vec<bool, 16>) {}

// CHECK: 0 | class cl::sycl::vec<_Bool, 16>
// CHECK-NEXT: 0 | cl::sycl::vec<_Bool, 16>::DataType m_Data
// CHECK-NEXT: | [sizeof=16, dsize=16, align=16,
// CHECK-NEXT: | nvsize=16, nvalign=16]