1
0
mirror of https://github.com/fumiama/base16384-sycl.git synced 2026-06-08 03:56:19 +08:00

optimize(test): move test kernels into test class

This commit is contained in:
源文雨
2025-10-09 16:08:09 +08:00
parent cbe9cda397
commit 24ea4ca7bd
6 changed files with 44 additions and 28 deletions

View File

@@ -5,12 +5,12 @@ set(LOCAL_B14LIBS "")
foreach(CPP_FILE ${CPP_FILES})
# name without .cpp
get_filename_component(TARGET_NAME ${CPP_FILE} NAME_WE)
message(STATUS "Add lib: ${TARGET_NAME}")
message(STATUS "Add CPP lib: ${TARGET_NAME}")
add_library(${TARGET_NAME} STATIC ${CPP_FILE})
set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}")
set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
list(APPEND LOCAL_B14LIBS ${TARGET_NAME})
endforeach()

14
libs/test_kernels.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include <stdint.h>
#include <sycl/sycl.hpp>
#include "test.hpp"
SYCL_EXTERNAL uint8_t base16384::test::kernels_basic(uint8_t in) {
in *= in;
in %= 251;
in ^= in >> 2;
in += 17;
in *= 3;
return in ^ (in << 1);
}