44 #include <pvsutil/Logger.h>
46 #include <SkelCL/detail/Program.h>
47 #include <SkelCL/detail/Util.h>
53 class ProgramTest :
public ::testing::Test {
56 pvsutil::defaultLogger.setLoggingLevel(pvsutil::Logger::Severity::Debug);
63 TEST_F(ProgramTest, RenameFunction) {
64 std::string s(
"float func(float f) { return -f; }" );
65 std::string hashString(skelcl::detail::util::hash(s));
69 typedef float SCL_TYPE_0;
70 typedef float SCL_TYPE_1;
72 __kernel void SCL_MAP(
73 const __global SCL_TYPE_0* SCL_IN,
74 __global SCL_TYPE_1* SCL_OUT,
75 const unsigned int SCL_ELEMENTS )
77 if (get_global_id(0) < SCL_ELEMENTS) {
78 SCL_OUT[get_global_id(0)] = SCL_FUNC(SCL_IN[get_global_id(0)]);
83 skelcl::detail::Program program(s, hashString);
85 program.renameFunction("func",
"SCL_FUNC");
86 program.adjustTypes<int,
char>();