Skip to content

Commit

Permalink
Fixes #24
Browse files Browse the repository at this point in the history
Adds custom make targets: examples and benchmarks
From now,
`make` or `make all` will compile examples/ and benchmarks/
`make examples` will compile examples/
`make benchmarks` will compile benchmarks/
Also, benchmark folder has been renamed to benchmarks.
  • Loading branch information
ashok-arora committed Dec 19, 2020
1 parent fae7839 commit 1c2ed66
Show file tree
Hide file tree
Showing 70 changed files with 193 additions and 17 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,21 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

# set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

include_directories(${Matrix_SOURCE_DIR}/include)
include_directories(${Matrix_SOURCE_DIR}/lib/benchmark/include)
link_directories(${Matrix_SOURCE_DIR}/lib/benchmark/build/src)


add_custom_target(examples)
add_subdirectory(examples)

add_custom_target(benchmarks)
add_subdirectory(benchmarks)
Binary file removed benchmark/linux_binaries/BM_T
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_abs
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_addition
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_all
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_argmax
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_argmin
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_concatenate
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_delete_
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_determinant
Binary file not shown.
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_exp
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_eye
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_genfromtxt
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_get
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_indexing
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_init
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_inverse
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_log
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_matmul
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_max
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_mean
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_min
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_ones
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_power
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_reciprocal
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_slice
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_slice_select
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_sqrt
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_std
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_sum
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_to_double
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_unary_minus
Binary file not shown.
Binary file removed benchmark/linux_binaries/BM_zeros
Binary file not shown.
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.
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.
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.
133 changes: 133 additions & 0 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
add_dependencies(benchmarks
BM_abs
BM_addition
BM_all
BM_argmax
BM_argmin
BM_concatenate
BM_delete_
BM_determinant
BM_element_wise_multiplication
BM_exp
BM_eye
BM_genfromtxt
BM_get
BM_indexing
BM_init
BM_inverse
BM_log
BM_matmul
BM_max
BM_mean
BM_min
BM_ones
BM_power
BM_reciprocal
BM_slice
BM_slice_select
BM_sqrt
BM_std
BM_sum
BM_T
BM_to_double
BM_unary_minus
BM_zeros
)
add_executable(BM_abs BM_abs.cpp)
target_link_libraries(BM_abs PUBLIC benchmark benchmark_main pthread)

add_executable(BM_addition BM_addition.cpp)
target_link_libraries(BM_addition PUBLIC benchmark benchmark_main pthread)

add_executable(BM_all BM_all.cpp)
target_link_libraries(BM_all PUBLIC benchmark benchmark_main pthread)

add_executable(BM_argmax BM_argmax.cpp)
target_link_libraries(BM_argmax PUBLIC benchmark benchmark_main pthread)

add_executable(BM_argmin BM_argmin.cpp)
target_link_libraries(BM_argmin PUBLIC benchmark benchmark_main pthread)

add_executable(BM_concatenate BM_concatenate.cpp)
target_link_libraries(BM_concatenate PUBLIC benchmark benchmark_main pthread)

add_executable(BM_delete_ BM_delete_.cpp)
target_link_libraries(BM_delete_ PUBLIC benchmark benchmark_main pthread)

add_executable(BM_determinant BM_determinant.cpp)
target_link_libraries(BM_determinant PUBLIC benchmark benchmark_main pthread)

add_executable(BM_element_wise_multiplication BM_element_wise_multiplication.cpp)
target_link_libraries(BM_element_wise_multiplication PUBLIC benchmark benchmark_main pthread)

add_executable(BM_exp BM_exp.cpp)
target_link_libraries(BM_exp PUBLIC benchmark benchmark_main pthread)

add_executable(BM_eye BM_eye.cpp)
target_link_libraries(BM_eye PUBLIC benchmark benchmark_main pthread)

add_executable(BM_genfromtxt BM_genfromtxt.cpp)
target_link_libraries(BM_genfromtxt PUBLIC benchmark benchmark_main pthread)

add_executable(BM_get BM_get.cpp)
target_link_libraries(BM_get PUBLIC benchmark benchmark_main pthread)

add_executable(BM_indexing BM_indexing.cpp)
target_link_libraries(BM_indexing PUBLIC benchmark benchmark_main pthread)

add_executable(BM_init BM_init.cpp)
target_link_libraries(BM_init PUBLIC benchmark benchmark_main pthread)

add_executable(BM_inverse BM_inverse.cpp)
target_link_libraries(BM_inverse PUBLIC benchmark benchmark_main pthread)

add_executable(BM_log BM_log.cpp)
target_link_libraries(BM_log PUBLIC benchmark benchmark_main pthread)

add_executable(BM_matmul BM_matmul.cpp)
target_link_libraries(BM_matmul PUBLIC benchmark benchmark_main pthread)

add_executable(BM_max BM_max.cpp)
target_link_libraries(BM_max PUBLIC benchmark benchmark_main pthread)

add_executable(BM_mean BM_mean.cpp)
target_link_libraries(BM_mean PUBLIC benchmark benchmark_main pthread)

add_executable(BM_min BM_min.cpp)
target_link_libraries(BM_min PUBLIC benchmark benchmark_main pthread)

add_executable(BM_ones BM_ones.cpp)
target_link_libraries(BM_ones PUBLIC benchmark benchmark_main pthread)

add_executable(BM_power BM_power.cpp)
target_link_libraries(BM_power PUBLIC benchmark benchmark_main pthread)

add_executable(BM_reciprocal BM_reciprocal.cpp)
target_link_libraries(BM_reciprocal PUBLIC benchmark benchmark_main pthread)

add_executable(BM_slice BM_slice.cpp)
target_link_libraries(BM_slice PUBLIC benchmark benchmark_main pthread)

add_executable(BM_slice_select BM_slice_select.cpp)
target_link_libraries(BM_slice_select PUBLIC benchmark benchmark_main pthread)

add_executable(BM_sqrt BM_sqrt.cpp)
target_link_libraries(BM_sqrt PUBLIC benchmark benchmark_main pthread)

add_executable(BM_std BM_std.cpp)
target_link_libraries(BM_std PUBLIC benchmark benchmark_main pthread)

add_executable(BM_sum BM_sum.cpp)
target_link_libraries(BM_sum PUBLIC benchmark benchmark_main pthread)

add_executable(BM_T BM_T.cpp)
target_link_libraries(BM_T PUBLIC benchmark benchmark_main pthread)

add_executable(BM_to_double BM_to_double.cpp)
target_link_libraries(BM_to_double PUBLIC benchmark benchmark_main pthread)

add_executable(BM_unary_minus BM_unary_minus.cpp)
target_link_libraries(BM_unary_minus PUBLIC benchmark benchmark_main pthread)

add_executable(BM_zeros BM_zeros.cpp)
target_link_libraries(BM_zeros PUBLIC benchmark benchmark_main pthread)
File renamed without changes.
63 changes: 46 additions & 17 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,56 @@
add_dependencies(examples
abs
addition
argmin_argmax
concatenate
delete_
determinant
element_wise_multiplication
exp
genfromtxt
get_mat
indexing
initialize
inverse
log
matrix_calc
matrix_multiplication
min_max
power
reciprocal
slice_matrix
slice_out-of-bounds_error
slice_select
sqrt
string_to_double
transpose
unary_minus
view_matrix
)
add_executable(abs abs.cpp)
add_executable(determinant determinant.cpp)
add_executable(initialize initialize.cpp)
add_executable(min_max min_max.cpp)
add_executable(slice_out-of-bounds_error slice_out-of-bounds_error.cpp)
add_executable(unary_minus unary_minus.cpp)
add_executable(addition addition.cpp)
add_executable(element_wise_multiplication element_wise_multiplication.cpp)
add_executable(inverse inverse.cpp)
add_executable(power power.cpp)
add_executable(slice_select slice_select.cpp)
add_executable(view_matrix view_matrix.cpp)
add_executable(argmin_argmax argmin_argmax.cpp)
add_executable(concatenate concatenate.cpp)
add_executable(delete_ delete_.cpp)
add_executable(determinant determinant.cpp)
add_executable(element_wise_multiplication element_wise_multiplication.cpp)
add_executable(exp exp.cpp)
add_executable(log log.cpp)
add_executable(genfromtxt genfromtxt.cpp)
add_executable(sqrt sqrt.cpp)
add_executable(concatenate concatenate.cpp)
add_executable(get_mat get_mat.cpp)
add_executable(matrix_calc matrix_calc.cpp)
add_executable(reciprocal reciprocal.cpp)
add_executable(string_to_double string_to_double.cpp)
add_executable(delete_ delete_.cpp)
add_executable(indexing indexing.cpp)
add_executable(initialize initialize.cpp)
add_executable(inverse inverse.cpp)
add_executable(log log.cpp)
add_executable(matrix_calc matrix_calc.cpp)
add_executable(matrix_multiplication matrix_multiplication.cpp)
add_executable(min_max min_max.cpp)
add_executable(power power.cpp)
add_executable(reciprocal reciprocal.cpp)
add_executable(slice_matrix slice_matrix.cpp)
add_executable(slice_out-of-bounds_error slice_out-of-bounds_error.cpp)
add_executable(slice_select slice_select.cpp)
add_executable(sqrt sqrt.cpp)
add_executable(string_to_double string_to_double.cpp)
add_executable(transpose transpose.cpp)
add_executable(unary_minus unary_minus.cpp)
add_executable(view_matrix view_matrix.cpp)

0 comments on commit 1c2ed66

Please sign in to comment.