Skip to content

Simplify cmake structure #3

@learning-chip

Description

@learning-chip

the CMakeLists.txt can be greatly simplified... no need for the ascendc_library() wrapper, just a few flags like this compile.sh

Then, the #include "kernel_operator.h" header can also be removed.

For example, those are not needed:

if(EXISTS ${ASCEND_CANN_PACKAGE_PATH}/tools/tikcpp/ascendc_kernel_cmake)
set(ASCENDC_CMAKE_DIR
${ASCEND_CANN_PACKAGE_PATH}/tools/tikcpp/ascendc_kernel_cmake)
elseif(EXISTS ${ASCEND_CANN_PACKAGE_PATH}/compiler/tikcpp/ascendc_kernel_cmake)
set(ASCENDC_CMAKE_DIR
${ASCEND_CANN_PACKAGE_PATH}/compiler/tikcpp/ascendc_kernel_cmake)
elseif(EXISTS ${ASCEND_CANN_PACKAGE_PATH}/ascendc_devkit/tikcpp/samples/cmake)
set(ASCENDC_CMAKE_DIR
${ASCEND_CANN_PACKAGE_PATH}/ascendc_devkit/tikcpp/samples/cmake)
else()
message(
FATAL_ERROR
"ascendc_kernel_cmake does not exist, please check whether the cann package is installed."
)
endif()

Many of those are also likely not needed:

pto-kernels/CMakeLists.txt

Lines 136 to 142 in a221794

ascendcl
tiling_api
register
platform
ascendalog
dl
no_workspace_kernel)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code hygieneTasks that aim to improve code quality.

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions