Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new tests for BLAS-like and BLAS API #4457

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ config_last.h
getarch
getarch_2nd
utest/openblas_utest
utest/openblas_utest_ext
ctest/xccblat1
ctest/xccblat2
ctest/xccblat3
Expand Down
76 changes: 76 additions & 0 deletions utest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,70 @@ else ()
)
endif ()


set(DIR_EXT test_extensions)
set(OpenBLAS_utest_ext_src
utest_main.c
${DIR_EXT}/common.c
${DIR_EXT}/xerbla.c
${DIR_EXT}/test_isamin.c
${DIR_EXT}/test_idamin.c
${DIR_EXT}/test_icamin.c
${DIR_EXT}/test_izamin.c
${DIR_EXT}/test_ssum.c
${DIR_EXT}/test_dsum.c
${DIR_EXT}/test_scsum.c
${DIR_EXT}/test_dzsum.c
${DIR_EXT}/test_samin.c
${DIR_EXT}/test_damin.c
${DIR_EXT}/test_scamin.c
${DIR_EXT}/test_dzamin.c
${DIR_EXT}/test_scamax.c
${DIR_EXT}/test_dzamax.c
${DIR_EXT}/test_zrotg.c
${DIR_EXT}/test_crotg.c
${DIR_EXT}/test_drotmg.c
${DIR_EXT}/test_srotmg.c
${DIR_EXT}/test_zscal.c
${DIR_EXT}/test_cscal.c
${DIR_EXT}/test_domatcopy.c
${DIR_EXT}/test_somatcopy.c
${DIR_EXT}/test_zomatcopy.c
${DIR_EXT}/test_comatcopy.c
${DIR_EXT}/test_simatcopy.c
${DIR_EXT}/test_dimatcopy.c
${DIR_EXT}/test_cimatcopy.c
${DIR_EXT}/test_zimatcopy.c
${DIR_EXT}/test_sgeadd.c
${DIR_EXT}/test_dgeadd.c
${DIR_EXT}/test_cgeadd.c
${DIR_EXT}/test_zgeadd.c
${DIR_EXT}/test_saxpby.c
${DIR_EXT}/test_daxpby.c
${DIR_EXT}/test_caxpby.c
${DIR_EXT}/test_zaxpby.c
${DIR_EXT}/test_caxpyc.c
${DIR_EXT}/test_zaxpyc.c
${DIR_EXT}/test_cgemv_t.c
${DIR_EXT}/test_zgemv_t.c
${DIR_EXT}/test_cgemv_n.c
${DIR_EXT}/test_zgemv_n.c
${DIR_EXT}/test_crot.c
${DIR_EXT}/test_zrot.c
${DIR_EXT}/test_cgbmv.c
${DIR_EXT}/test_zgbmv.c
${DIR_EXT}/test_dgemmt.c
${DIR_EXT}/test_sgemmt.c
${DIR_EXT}/test_cgemmt.c
${DIR_EXT}/test_zgemmt.c
${DIR_EXT}/test_ztrmv.c
${DIR_EXT}/test_ctrmv.c
${DIR_EXT}/test_ztrsv.c
${DIR_EXT}/test_ctrsv.c
${DIR_EXT}/test_zgemm.c
${DIR_EXT}/test_cgemm.c
)

# crashing on travis cl with an error code suggesting resource not found
if (NOT MSVC)
set(OpenBLAS_utest_src
Expand Down Expand Up @@ -46,6 +110,13 @@ set(OpenBLAS_utest_src
${OpenBLAS_utest_src}
test_potrs.c
)
set(OpenBLAS_utest_ext_src
${OpenBLAS_utest_ext_src}
${DIR_EXT}/test_cspmv.c
${DIR_EXT}/test_zspmv.c
${DIR_EXT}/test_csbmv.c
${DIR_EXT}/test_zsbmv.c
)
if (NOT NO_CBLAS AND NOT NO_LAPACKE)
set(OpenBLAS_utest_src
${OpenBLAS_utest_src}
Expand All @@ -57,7 +128,11 @@ endif()
set(OpenBLAS_utest_bin openblas_utest)
add_executable(${OpenBLAS_utest_bin} ${OpenBLAS_utest_src})

set(OpenBLAS_utest_ext_bin openblas_utest_ext)
add_executable(${OpenBLAS_utest_ext_bin} ${OpenBLAS_utest_ext_src})

target_link_libraries(${OpenBLAS_utest_bin} ${OpenBLAS_LIBNAME})
target_link_libraries(${OpenBLAS_utest_ext_bin} ${OpenBLAS_LIBNAME})

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "QNX" )
target_link_libraries(${OpenBLAS_utest_bin} m)
Expand All @@ -82,3 +157,4 @@ add_custom_command(TARGET ${OpenBLAS_utest_bin}
endif()

add_test(${OpenBLAS_utest_bin} ${CMAKE_CURRENT_BINARY_DIR}/${OpenBLAS_utest_bin})
add_test(${OpenBLAS_utest_ext_bin} ${CMAKE_CURRENT_BINARY_DIR}/${OpenBLAS_utest_bin})
30 changes: 26 additions & 4 deletions utest/Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
UTEST_CHECK = 1
TOPDIR = ..
DIR_EXT=test_extensions

override TARGET_ARCH=
override TARGET_MACH=

UTESTBIN=openblas_utest
UTESTEXTBIN=openblas_utest_ext

.PHONY : all
.NOTPARALLEL : all run_test $(UTESTBIN)
.NOTPARALLEL : all run_test $(UTESTBIN) $(UTESTEXTBIN)

include $(TOPDIR)/Makefile.system

OBJS=utest_main.o test_min.o test_amax.o test_ismin.o test_rotmg.o test_axpy.o test_dotu.o test_dsdot.o test_swap.o test_rot.o test_dnrm2.o
#test_rot.o test_swap.o test_axpy.o test_dotu.o test_dsdot.o test_fork.o
OBJS_EXT=utest_main.o $(DIR_EXT)/xerbla.o $(DIR_EXT)/common.o
OBJS_EXT+=$(DIR_EXT)/test_isamin.o $(DIR_EXT)/test_idamin.o $(DIR_EXT)/test_icamin.o $(DIR_EXT)/test_izamin.o
OBJS_EXT+=$(DIR_EXT)/test_ssum.o $(DIR_EXT)/test_dsum.o $(DIR_EXT)/test_scsum.o $(DIR_EXT)/test_dzsum.o
OBJS_EXT+=$(DIR_EXT)/test_saxpby.o $(DIR_EXT)/test_daxpby.o $(DIR_EXT)/test_caxpby.o $(DIR_EXT)/test_zaxpby.o $(DIR_EXT)/test_zaxpyc.o $(DIR_EXT)/test_caxpyc.o
OBJS_EXT+=$(DIR_EXT)/test_samin.o $(DIR_EXT)/test_damin.o $(DIR_EXT)/test_scamin.o $(DIR_EXT)/test_dzamin.o $(DIR_EXT)/test_scamax.o $(DIR_EXT)/test_dzamax.o
OBJS_EXT+=$(DIR_EXT)/test_drotmg.o $(DIR_EXT)/test_srotmg.o $(DIR_EXT)/test_zrotg.o $(DIR_EXT)/test_crotg.o $(DIR_EXT)/test_crot.o $(DIR_EXT)/test_zrot.o
OBJS_EXT+=$(DIR_EXT)/test_zscal.o $(DIR_EXT)/test_cscal.o
OBJS_EXT+=$(DIR_EXT)/test_domatcopy.o $(DIR_EXT)/test_somatcopy.o $(DIR_EXT)/test_zomatcopy.o $(DIR_EXT)/test_comatcopy.o
OBJS_EXT+=$(DIR_EXT)/test_simatcopy.o $(DIR_EXT)/test_dimatcopy.o $(DIR_EXT)/test_cimatcopy.o $(DIR_EXT)/test_zimatcopy.o
OBJS_EXT+=$(DIR_EXT)/test_sgeadd.o $(DIR_EXT)/test_dgeadd.o $(DIR_EXT)/test_cgeadd.o $(DIR_EXT)/test_zgeadd.o
OBJS_EXT+=$(DIR_EXT)/test_cgemv_t.o $(DIR_EXT)/test_zgemv_t.o $(DIR_EXT)/test_cgemv_n.o $(DIR_EXT)/test_zgemv_n.o
OBJS_EXT+=$(DIR_EXT)/test_sgemmt.o $(DIR_EXT)/test_dgemmt.o $(DIR_EXT)/test_cgemmt.o $(DIR_EXT)/test_zgemmt.o
OBJS_EXT+=$(DIR_EXT)/test_ztrmv.o $(DIR_EXT)/test_ctrmv.o $(DIR_EXT)/test_ztrsv.o $(DIR_EXT)/test_ctrsv.o
OBJS_EXT+=$(DIR_EXT)/test_zgemm.o $(DIR_EXT)/test_cgemm.o $(DIR_EXT)/test_zgbmv.o $(DIR_EXT)/test_cgbmv.o

ifneq ($(NO_LAPACK), 1)
OBJS += test_potrs.o
OBJS_EXT += $(DIR_EXT)/test_zspmv.o $(DIR_EXT)/test_cspmv.o $(DIR_EXT)/test_zsbmv.o $(DIR_EXT)/test_csbmv.o
ifneq ($(NO_CBLAS), 1)
ifneq ($(NO_LAPACKE), 1)
OBJS += test_kernel_regress.o
Expand Down Expand Up @@ -47,12 +64,17 @@ all : run_test
$(UTESTBIN): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ ../$(LIBNAME) $(EXTRALIB) $(FEXTRALIB)

run_test: $(UTESTBIN)
$(UTESTEXTBIN): $(OBJS_EXT)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ ../$(LIBNAME) $(EXTRALIB) $(FEXTRALIB)

run_test: $(UTESTBIN) $(UTESTEXTBIN)
ifneq ($(CROSS), 1)
./$(UTESTBIN)
./$(UTESTEXTBIN)
endif

clean:
-rm -f *.o $(UTESTBIN)
-rm -f *.o $(UTESTBIN) $(UTESTEXTBIN)
-rm -f $(DIR_EXT)/*.o

libs:
libs:
Loading
Loading