set(OBJ_LIST_OUT "")
foreach (source_file ${sources_in})
- string(SUBSTRING ${float_type_in} 0 1 float_char)
- string(TOLOWER ${float_char} float_char)
+ if (NOT float_type_in STREQUAL "")
+ string(SUBSTRING ${float_type_in} 0 1 float_char)
+ string(TOLOWER ${float_char} float_char)
+ endif ()
if (NOT name_in)
get_filename_component(source_name ${source_file} NAME_WE)
# If 0, it will simply append the code, e.g. symm_L.c with TRANS and UNIT will be symm_LTU.
# If 2, it will append the code with an underscore, e.g. symm.c with TRANS and UNIT will be symm_TU.
# If 3, it will insert the code *around* the last character with an underscore, e.g. symm_L.c with TRANS and UNIT will be symm_TLU (required by BLAS level2 objects).
+# @param alternate_name replaces the source name as the object name (define codes are still appended)
function(GenerateCombinationObjects sources_in defines_in absent_codes_in float_type_in all_defines_in replace_scheme)
+ if (DEFINED ARGV6)
+ set(alternate_name ${ARGV6})
+ endif ()
+
AllCombinations("${defines_in}" "${absent_codes_in}")
set(define_combos ${LIST_OUT})
set(define_codes ${CODES_OUT})
endif ()
endif ()
- GenerateNamedObjects("${source_file}" "${float_type_in}" "${cur_defines}" "" 0 "${replace_code}" "${append_code}")
+ GenerateNamedObjects("${source_file}" "${float_type_in}" "${cur_defines}" "${alternate_name}" 0 "${replace_code}" "${append_code}")
list(APPEND COMBO_OBJ_LIST_OUT "${OBJ_LIST_OUT}")
endforeach ()
endforeach ()
string(TOLOWER ${GEMM_DEFINE} GEMM_DEFINE_LC)
GenerateNamedObjects("gemm.c" "DOUBLE" "${GEMM_DEFINE}" "gemm_${GEMM_DEFINE_LC}" 0)
list(APPEND DBLAS_OBJS ${OBJ_LIST_OUT})
+ if (SMP AND NOT USE_SIMPLE_THREADED_LEVEL3)
+ GenerateNamedObjects("gemm.c" "DOUBLE" "${GEMM_DEFINE};THREADED_LEVEL3" "gemm_thread_${GEMM_DEFINE_LC}" 0)
+ list(APPEND DBLAS_OBJS ${OBJ_LIST_OUT})
+ endif ()
endforeach ()
GenerateCombinationObjects("trmm_L.c;trmm_R.c;trsm_L.c;trsm_R.c" "TRANS;UPPER;UNIT" "N;L;N" "DOUBLE" "" 0)
GenerateCombinationObjects("syrk_kernel.c;syr2k_kernel.c" "LOWER" "U" "DOUBLE" "" 2)
list(APPEND DBLAS_OBJS ${COMBO_OBJ_LIST_OUT})
-#if (SMP)
-#
-# COMMONOBJS += gemm_thread_m.c gemm_thread_n.c gemm_thread_mn.c gemm_thread_variable.c
-# COMMONOBJS += syrk_thread.c
-#
-# if (USE_SIMPLE_THREADED_LEVEL3)
-# DBLASOBJS += dgemm_thread_nn.c dgemm_thread_nt.c dgemm_thread_tn.c dgemm_thread_tt.c
-# DBLASOBJS += dsymm_thread_LU.c dsymm_thread_LL.c dsymm_thread_RU.c dsymm_thread_RL.c
-# DBLASOBJS += dsyrk_thread_UN.c dsyrk_thread_UT.c dsyrk_thread_LN.c dsyrk_thread_LT.c
-#
-# endif ()
-#endif ()
-#
+if (SMP)
+
+ # N.B. these do NOT have a float type (e.g. DOUBLE) defined!
+ GenerateNamedObjects("gemm_thread_m.c;gemm_thread_n.c;gemm_thread_mn.c;gemm_thread_variable.c;syrk_thread.c" "" "" "" 0)
+ list(APPEND DBLAS_OBJS ${OBJ_LIST_OUT})
+
+ if (NOT USE_SIMPLE_THREADED_LEVEL3)
+ GenerateCombinationObjects("syrk_k.c" "LOWER;TRANS" "U;N" "DOUBLE" "THREADED_LEVEL3" 2 "syrk_thread")
+ list(APPEND DBLAS_OBJS ${COMBO_OBJ_LIST_OUT})
+ GenerateCombinationObjects("symm_k.c" "RSIDE;LOWER" "L;U" "DOUBLE" "THREADED_LEVEL3;NN" 2 "symm_thread")
+ list(APPEND DBLAS_OBJS ${COMBO_OBJ_LIST_OUT})
+ endif ()
+endif ()
+
#HPLOBJS =
# dgemm_nn.c dgemm_nt.c dgemm_tn.c dgemm_tt.c
# dtrsm_LNUU.c dtrsm_LNUN.c dtrsm_LNLU.c dtrsm_LNLN.c