Skip to content

Commit

Permalink
Fix restructuring (codeplaysoftware#288)
Browse files Browse the repository at this point in the history
* Fixing the new restructuring causing break in the build of library and breaking DPCPP compiler.

* updating the computeCpp

* reverting the change in auto-tuner

* applying clang-format
  • Loading branch information
mehdi-goli authored Apr 1, 2021
1 parent bc5f52d commit 91686e9
Show file tree
Hide file tree
Showing 40 changed files with 533 additions and 1,186 deletions.
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,9 @@ endif()
# * NAIVE_GEMM
include(CmakeFunctionHelper)

# Add the common library used by sycl_blas, tests and benchmarks
add_subdirectory(common)

add_subdirectory(src)
build_library(sycl_blas)

target_link_libraries(sycl_blas PUBLIC sycl_blas_common)

if (WIN32)
# On Windows, all symbols must be resolved at link time for DLLs.
# The sycl_blas target is just a collection of other objects so
Expand Down
6 changes: 3 additions & 3 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ include_directories(${BLAS_BENCH})
add_subdirectory(${BLAS_BENCH}/syclblas)

if (BUILD_CLBLAST_BENCHMARKS)
add_subdirectory(${BLAS_BENCH}/clblast)
add_subdirectory(${BLAS_BENCH}/clBench/clblast)
endif()

if (BUILD_ACL_BENCHMARKS)
add_subdirectory(${BLAS_BENCH}/acl)
add_subdirectory(${BLAS_BENCH}/clBench/acl)
endif()

if(BUILD_CLBLAS_BENCHMARKS)
add_subdirectory(${BLAS_BENCH}/clblas)
add_subdirectory(${BLAS_BENCH}/clBench/clblas)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ endif()

function(generate_acl_benchmark name source definition)
add_executable(${name} ${source} main.cpp)
target_link_libraries(${name} PRIVATE benchmark acl sycl_blas_common sycl_blas Clara::Clara)
target_include_directories(${name} PRIVATE ${CBLAS_INCLUDE})
target_link_libraries(${name} PRIVATE benchmark acl sycl_blas Clara::Clara)
target_include_directories(${name} PRIVATE ${CBLAS_INCLUDE} ${BLAS_BENCH} ${SYCLBLAS_INCLUDE} ${SYCLBLAS_COMMON_INCLUDE_DIR})
target_compile_definitions(${name} PRIVATE ${definition})

if(BLAS_VERIFY_BENCHMARK)
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions benchmark/acl/utils.hpp → benchmark/clBench/acl/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define ACL_UTILS_HPP

#include <CL/cl.h>
#include <clBench/clwrap.hpp>
#include <arm_compute/core/Helpers.h>
#include <arm_compute/core/ITensor.h>
#include <arm_compute/core/Types.h>
Expand Down Expand Up @@ -81,8 +82,8 @@ void extract_tensor(tensor_t &tensor, std::vector<float> &dst) {
* @brief No event time for ACL. Return 0
*/
template <>
inline cl_ulong time_event<void *>(void *&e) {
return 0;
inline double time_event<void *>(void *&e) {
return double(0);
}

} // namespace utils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ set(sources
foreach(clblas_benchmark ${sources})
get_filename_component(clblas_bench_exec ${clblas_benchmark} NAME_WE)
add_executable(bench_clblas_${clblas_bench_exec} ${clblas_benchmark} "main.cpp")
target_link_libraries(bench_clblas_${clblas_bench_exec} PRIVATE benchmark Clara::Clara sycl_blas_common sycl_blas)
target_include_directories(bench_clblas_${clblas_bench_exec} PRIVATE ${CLBLAS_INCLUDE_DIRS})
target_link_libraries(bench_clblas_${clblas_bench_exec} PRIVATE benchmark Clara::Clara sycl_blas)
target_include_directories(bench_clblas_${clblas_bench_exec} PRIVATE ${CLBLAS_INCLUDE_DIRS} ${BLAS_BENCH} ${SYCLBLAS_INCLUDE} ${SYCLBLAS_COMMON_INCLUDE_DIR})
target_link_libraries(bench_clblas_${clblas_bench_exec} PRIVATE ${CLBLAS_LIBRARIES})

if(BLAS_VERIFY_BENCHMARK)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define CLBLAST_UTILS_HPP

#include <common/common_utils.hpp>
#include <clBench/clwrap.hpp>
#include <clBLAS.h>

typedef Context ExecutorType;
Expand Down Expand Up @@ -111,7 +112,7 @@ static inline clblasDiag translate_diagonal(const char *diag) {
* CLEventHandler class in clwrap.h)
*/
template <>
inline cl_ulong time_event<cl_event>(cl_event &e) {
inline double time_event<cl_event>(cl_event &e) {
cl_ulong start_time, end_time;
bool all_ok = true;
// Declare a lambda to check the result of the calls
Expand Down Expand Up @@ -155,10 +156,10 @@ inline cl_ulong time_event<cl_event>(cl_event &e) {

// Return the delta
if (all_ok) {
return (end_time - start_time);
return static_cast<double>(end_time - start_time);
} else {
// Return a really big number to show that we've failed.
return 0xFFFFFFFFFFFFFFFF;
return static_cast<double>(0xFFFFFFFFFFFFFFFF);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ set(sources
foreach(clblast_benchmark ${sources})
get_filename_component(clblast_bench_exec ${clblast_benchmark} NAME_WE)
add_executable(bench_clblast_${clblast_bench_exec} ${clblast_benchmark} main.cpp)
target_link_libraries(bench_clblast_${clblast_bench_exec} PRIVATE benchmark Clara::Clara clblast sycl_blas_common)
target_include_directories(bench_clblast_${clblast_bench_exec} PRIVATE ${CBLAS_INCLUDE})
target_link_libraries(bench_clblast_${clblast_bench_exec} PRIVATE benchmark Clara::Clara clblast)
target_include_directories(bench_clblast_${clblast_bench_exec} PRIVATE ${SYCLBLAS_INCLUDE} ${CBLAS_INCLUDE} ${BLAS_BENCH} ${SYCLBLAS_COMMON_INCLUDE_DIR})

if(BLAS_VERIFY_BENCHMARK)
target_link_libraries(bench_clblast_${clblast_bench_exec} PRIVATE blas::blas)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define CLBLAST_UTILS_HPP

#include <common/common_utils.hpp>
#include <clBench/clwrap.hpp>
#include <clblast.h>

typedef Context ExecutorType;
Expand Down Expand Up @@ -136,7 +137,7 @@ static inline clblast::Diagonal translate_diagonal(const char *diag) {
* CLEventHandler class in clwrap.h)
*/
template <>
inline cl_ulong time_event<cl_event>(cl_event &e) {
inline double time_event<cl_event>(cl_event &e) {
cl_ulong start_time, end_time;
bool all_ok = true;
// Declare a lambda to check the result of the calls
Expand Down Expand Up @@ -180,10 +181,10 @@ inline cl_ulong time_event<cl_event>(cl_event &e) {

// Return the delta
if (all_ok) {
return (end_time - start_time);
return static_cast<double>(end_time - start_time);
} else {
// Return a really big number to show that we've failed.
return 0xFFFFFFFFFFFFFFFF;
return static_cast<double>(0xFFFFFFFFFFFFFFFF);
}
}

Expand Down
Loading

0 comments on commit 91686e9

Please sign in to comment.