Skip to content

Commit 456a3a0

Browse files
committed
revert load_store changes
change STRICT build optimization level make run CI use STRICT build
1 parent e4af00f commit 456a3a0

4 files changed

Lines changed: 20 additions & 16 deletions

File tree

.github/workflows/oneapi_githubactions_run.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defaults:
99
shell: bash
1010

1111
env:
12-
BUILD_TYPE: RELEASE
12+
BUILD_TYPE: STRICT
1313

1414
jobs:
1515
buildrun:

include/targets/generic/load_store.h

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,14 @@ namespace quda
1111
static constexpr int size = prefetch;
1212
};
1313

14-
/**
15-
@brief Element type used for coalesced storage.
16-
*/
17-
template <typename T>
18-
using atom_t = std::conditional_t<sizeof(T) % 16 == 0, int4, std::conditional_t<sizeof(T) % 8 == 0, int2, int>>;
19-
2014
/**
2115
@brief Non-specialized load operation
2216
*/
2317
template <bool is_device> struct vector_load_impl {
2418
template <typename T, size_t prefetch_size>
2519
__device__ __host__ inline void operator()(T &value, const void *ptr, int idx, const prefetch_t<prefetch_size> &)
2620
{
27-
// value = reinterpret_cast<const T *>(ptr)[idx];
28-
memcpy(&value, static_cast<const T *>(ptr) + idx, sizeof(value));
21+
value = reinterpret_cast<const T *>(ptr)[idx];
2922
}
3023
};
3124

@@ -60,12 +53,11 @@ namespace quda
6053
template <bool is_device> struct vector_store_impl {
6154
template <typename T> __device__ __host__ inline void operator()(void *ptr, int idx, const T &value)
6255
{
63-
// reinterpret_cast<T *>(ptr)[idx] = value;
64-
memcpy(static_cast<T *>(ptr) + idx, &value, sizeof(value));
56+
reinterpret_cast<T *>(ptr)[idx] = value;
6557
}
6658
};
6759

68-
template <typename vector_t> __device__ __host__ inline void vector_storeV(void *ptr, int idx, const vector_t &value)
60+
template <typename vector_t> __device__ __host__ inline void vector_store(void *ptr, int idx, const vector_t &value)
6961
{
7062
target::dispatch<vector_store_impl>(ptr, idx, value);
7163
}
@@ -77,9 +69,7 @@ namespace quda
7769
vector_t value_v;
7870
static_assert(sizeof(value_a) == sizeof(value_v), "array type and vector type are different sizes");
7971
memcpy(&value_v, &value_a, sizeof(vector_t));
80-
// vector_storeV<vector_t>(ptr, idx, value_v);
81-
scalar_t *a = static_cast<scalar_t *>(ptr) + N * idx;
82-
memcpy(a, &value_v, sizeof(value_v));
72+
vector_store<vector_t>(ptr, idx, value_v);
8373
}
8474

8575
template <typename scalar_t, int N>

include/targets/sycl/load_store.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#pragma once
2+
3+
namespace quda
4+
{
5+
6+
/**
7+
@brief Element type used for coalesced storage.
8+
*/
9+
template <typename T>
10+
using atom_t = std::conditional_t<sizeof(T) % 16 == 0, int4, std::conditional_t<sizeof(T) % 8 == 0, int2, int>>;
11+
12+
} // namespace quda
13+
14+
#include "../generic/load_store.h"

lib/targets/sycl/target_sycl.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ set(CMAKE_SYCL_FLAGS_DEVEL
6363
"-O3 -gline-directives-only -Wall -Wextra"
6464
CACHE STRING "Flags used by the C++ compiler during regular development builds.")
6565
set(CMAKE_SYCL_FLAGS_STRICT
66-
"-O3 -Wall -Wextra -Werror"
66+
"-Os -Wall -Wextra -Werror"
6767
CACHE STRING "Flags used by the C++ compiler during strict jenkins builds.")
6868
set(CMAKE_SYCL_FLAGS_RELEASE
6969
"-O3 -w ${CXX_OPT}"

0 commit comments

Comments
 (0)