Skip to content

Commit

Permalink
Minor cmake adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
alpers-git committed Dec 12, 2024
1 parent 1d4a2a8 commit 7563270
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ if(ZFP_WITH_SYCL)
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")

add_definitions(-DZFP_WITH_SYCL_DEVICE=${ZFP_WITH_SYCL_DEVICE})
if(NOT("${ZFP_WITH_SYCL_DEVICE}" STREQUAL "PVC" OR "${ZFP_WITH_SYCL_DEVICE}" STREQUAL "pvc"))
add_definitions(-DDISABLE_BLOCK_8)
endif()
endif()

# Enable MACOSX_RPATH by default
Expand Down
12 changes: 6 additions & 6 deletions src/sycl/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ namespace internal {

using namespace ::sycl::ext::oneapi::experimental;

// inline constexpr unsigned char perm_1[]={0, 1, 2, 3};
inline static constexpr device_global<unsigned char[4]> perm_1{0, 1, 2, 3};
inline constexpr unsigned char perm_1[]={0, 1, 2, 3};
// inline static constexpr device_global<unsigned char[4]> perm_1{0, 1, 2, 3};

#define index(i, j) ((i) + 4 * (j))

// order coefficients (i, j) by i + j, then i^2 + j^2
// inline constexpr unsigned char perm_2[]=
inline static constexpr device_global<unsigned char[16]>perm_2
inline constexpr unsigned char perm_2[]=
// inline static constexpr device_global<unsigned char[16]>perm_2
{
index(0, 0), // 0 : 0

Expand Down Expand Up @@ -49,8 +49,8 @@ inline static constexpr device_global<unsigned char[16]>perm_2
#define index(x, y, z) ((x) + 4 * ((y) + 4 * (z)))

// order coefficients (i, j, k) by i + j + k, then i^2 + j^2 + k^2
// inline constexpr unsigned char perm_3[]=
inline static constexpr device_global<unsigned char[64]> perm_3
inline constexpr unsigned char perm_3[]=
// inline static constexpr device_global<unsigned char[64]> perm_3
{
index(0, 0, 0), // 0 : 0

Expand Down
5 changes: 4 additions & 1 deletion src/sycl/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -1059,9 +1059,11 @@ decode(
break;
case 2:
switch (params->min_sub_group_size) {
#ifdef DISABLE_BLOCK_8
case 8:
bits_read = internal::decode2<T, 8>(d_data, size, stride, params, d_stream, minbits, maxbits, maxprec, minexp, d_index, index_type, granularity);
break;
#endif
case 16:
bits_read = internal::decode2<T, 16>(d_data, size, stride, params, d_stream, minbits, maxbits, maxprec, minexp, d_index, index_type, granularity);
break;
Expand All @@ -1071,10 +1073,11 @@ decode(
break;
case 3:
switch (params->min_sub_group_size) {
#ifdef DISABLE_BLOCK_8
case 8:
bits_read = internal::decode3<T, 8>(d_data, size, stride, params, d_stream, minbits, maxbits, maxprec, minexp, d_index, index_type, granularity);
break;
case 16:
#endif
bits_read = internal::decode3<T, 16>(d_data, size, stride, params, d_stream, minbits, maxbits, maxprec, minexp, d_index, index_type, granularity);
break;
default:
Expand Down
4 changes: 4 additions & 0 deletions src/sycl/encode.h
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,11 @@ encode(
case 2:
switch (params->min_sub_group_size)
{
#ifdef DISABLE_BLOCK_8
case 8:
bits_written = internal::encode2<T, 8>(d_data, size, stride, params, d_stream, d_index, minbits, maxbits, maxprec, minexp);
break;
#endif
case 16:
bits_written = internal::encode2<T, 16>(d_data, size, stride, params, d_stream, d_index, minbits, maxbits, maxprec, minexp);
break;
Expand All @@ -750,9 +752,11 @@ encode(
case 3:
switch (params->min_sub_group_size)
{
#ifdef DISABLE_BLOCK_8
case 8:
bits_written = internal::encode3<T, 8>(d_data, size, stride, params, d_stream, d_index, minbits, maxbits, maxprec, minexp);
break;
#endif
case 16:
bits_written = internal::encode3<T, 16>(d_data, size, stride, params, d_stream, d_index, minbits, maxbits, maxprec, minexp);
break;
Expand Down
6 changes: 3 additions & 3 deletions src/sycl/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,21 +172,21 @@ template <>
inline
const unsigned char* get_perm<4>()
{
return perm_1.get();
return perm_1;
}

template <>
inline
const unsigned char* get_perm<16>()
{
return perm_2.get();
return perm_2;
}

template <>
inline
const unsigned char* get_perm<64>()
{
return perm_3.get();
return perm_3;
}

// maximum number of bit planes to encode/decode
Expand Down

0 comments on commit 7563270

Please sign in to comment.