From d620093a27274027393173418bf0f41ffdcd2c0c Mon Sep 17 00:00:00 2001 From: Alejandro Saucedo Date: Thu, 21 Jan 2021 21:51:37 +0000 Subject: [PATCH] Added further tests including lr --- .github/workflows/cpp_ubuntu.yml | 5 ++--- test/TestLogisticRegression.cpp | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cpp_ubuntu.yml b/.github/workflows/cpp_ubuntu.yml index 9a386ab..4bd53a0 100644 --- a/.github/workflows/cpp_ubuntu.yml +++ b/.github/workflows/cpp_ubuntu.yml @@ -36,11 +36,10 @@ jobs: make -C build/ -j - name: tests run: | - #only running tests that dont require GLSL compilation - ./build/test/test_kompute --gtest_filter="TestMainLogisticRegression.*" + # Only running tests that dont require GLSL compilation + ./build/test/test_kompute --gtest_filter="TestLogisticRegressionAlgorithm.*" ./build/test/test_kompute --gtest_filter="TestManager.*" ./build/test/test_kompute --gtest_filter="TestOpAlgoBase.ShaderCompiledDataFromConstructor" - #./build/test/test_kompute --gtest_filter="TestOpAlgoBase.ShaderCompiledDataFromFile" ./build/test/test_kompute --gtest_filter="TestOpTensorCopy.*" ./build/test/test_kompute --gtest_filter="TestOpTensorCreate.*" ./build/test/test_kompute --gtest_filter="TestOpTensorSync.*" diff --git a/test/TestLogisticRegression.cpp b/test/TestLogisticRegression.cpp index 2d39438..94f34b5 100644 --- a/test/TestLogisticRegression.cpp +++ b/test/TestLogisticRegression.cpp @@ -3,6 +3,8 @@ #include "kompute/Kompute.hpp" +#include "kompute_test/shaders/shadertest_logistic_regression.hpp" + TEST(TestLogisticRegressionAlgorithm, TestMainLogisticRegression) { @@ -44,8 +46,18 @@ TEST(TestLogisticRegressionAlgorithm, TestMainLogisticRegression) sq->record({ wIn, bIn }); +#ifdef KOMPUTE_SHADER_FROM_STRING sq->record( params, "test/shaders/glsl/test_logistic_regression.comp.spv"); +#else + sq->record( + params, + std::vector( + kp::shader_data::shaders_glsl_logisticregression_comp_spv, + kp::shader_data::shaders_glsl_logisticregression_comp_spv + + kp::shader_data:: + shaders_glsl_logisticregression_comp_spv_len)); +#endif sq->record({ wOutI, wOutJ, bOut, lOut }); @@ -123,8 +135,18 @@ TEST(TestLogisticRegressionAlgorithm, TestMainLogisticRegressionManualCopy) // Record op algo base sq->begin(); +#ifdef KOMPUTE_SHADER_FROM_STRING sq->record( params, "test/shaders/glsl/test_logistic_regression.comp.spv"); +#else + sq->record( + params, + std::vector( + kp::shader_data::shaders_glsl_logisticregression_comp_spv, + kp::shader_data::shaders_glsl_logisticregression_comp_spv + + kp::shader_data:: + shaders_glsl_logisticregression_comp_spv_len)); +#endif sq->record({ wOutI, wOutJ, bOut, lOut });