Skip to content

Commit

Permalink
[Feature](mlu-ops):modify cmake and kernels content.
Browse files Browse the repository at this point in the history
  • Loading branch information
mahxn0 committed Jan 25, 2024
1 parent 1f04352 commit 10143ab
Show file tree
Hide file tree
Showing 83 changed files with 71 additions and 20,310 deletions.
27 changes: 20 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,30 @@ endif()

list(SORT build_kernel)
message(STATUS "build_kernel:[${build_kernel}]")

foreach(kernel ${build_kernel})
if (NOT IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/kernels/${kernel}")

file(GLOB all_kernels "${CMAKE_CURRENT_LIST_DIR}/kernels/*")
foreach(kernel ${build_kernel} )
set(kernel_parent_dir '')
foreach (o ${all_kernels})
if (IS_DIRECTORY ${o})
get_filename_component(kernelname ${o} NAME)
if(IS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/kernels/${kernel} OR
IS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/kernels/${kernelname}/${kernel})
set(kernel_parent_dir ${kernelname})
endif()
endif()
endforeach ()
if (IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/kernels/${kernel}")
file(GLOB_RECURSE src_files ${src_files} "${CMAKE_CURRENT_SOURCE_DIR}/kernels/${kernel}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/kernels/${kernel}/*.mlu")
elseif(IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/kernels/${kernel_parent_dir}/${kernel}")
file(GLOB_RECURSE src_files ${src_files} "${CMAKE_CURRENT_SOURCE_DIR}/kernels/${kernel_parent_dir}/${kernel}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/kernels/${kernel_parent_dir}/${kernel}/*.mlu")
else()
message(WARNING "kernel/${kernel} is not a directory, ${kernel} is an alias")
continue()
endif()
file(GLOB_RECURSE src_files ${src_files} "${CMAKE_CURRENT_SOURCE_DIR}/kernels/${kernel}/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/kernels/${kernel}/*.mlu")
file(GLOB_RECURSE src_helper_files ${src_helper_files} "${CMAKE_CURRENT_SOURCE_DIR}/kernels/utils/cnnl_helper.cpp")
file(GLOB_RECURSE arch_binary_files ${arch_binary_files} "${CMAKE_CURRENT_SOURCE_DIR}/kernels/${kernel}/${MLUOP_TARGET_CPU_ARCH}/*.o")
endforeach()


file(GLOB_RECURSE src_helper_files ${src_helper_files} "${CMAKE_CURRENT_SOURCE_DIR}/kernels/utils/cnnl_helper.cpp")
file(GLOB_RECURSE core_src_files ${core_src_files} "${CMAKE_CURRENT_SOURCE_DIR}/core/*.cpp")
# set(src_files ${src_files} "${CMAKE_CURRENT_SOURCE_DIR}/test/main.cpp")

Expand Down
5 changes: 3 additions & 2 deletions kernel_depends.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ deform_roi_pool_forward = ["deform_roi_pool"]
deform_roi_pool_backward = ["deform_roi_pool"]
carafe_forward = ["carafe"]
carafe_backward = ["carafe"]
dcn_backward_weight = ["dcn_forward"]
dcn_backward_data = ["dcn_forward"]
dcn_backward_weight = ["dcn_common"]
dcn_backward_data = ["dcn_common"]
dcn_forward = ["dcn_common"]
161 changes: 0 additions & 161 deletions kernels/border_align_backward/border_align_backward.cpp

This file was deleted.

34 changes: 0 additions & 34 deletions kernels/border_align_backward/border_align_backward.h

This file was deleted.

Loading

0 comments on commit 10143ab

Please sign in to comment.