Skip to content

Commit

Permalink
wwip 3
Browse files Browse the repository at this point in the history
  • Loading branch information
q10 committed Nov 17, 2024
1 parent 840c7ee commit 7309648
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 13 deletions.
24 changes: 24 additions & 0 deletions cmake/modules/Utilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,27 @@ function(LIST_FILTER)

set(${args_OUTPUT} ${${args_OUTPUT}} PARENT_SCOPE)
endfunction()

function(add_to_package)
set(flags)
set(singleValueArgs DESTINATION)
set(multiValueArgs FILES TARGETS)

cmake_parse_arguments(
args
"${flags}" "${singleValueArgs}" "${multiValueArgs}"
${ARGN})

install(TARGETS ${args_TARGETS} DESTINATION ${args_DESTINATION})
install(FILES ${args_FILES} DESTINATION ${args_DESTINATION})

BLOCK_PRINT(
"Adding to Package: ${args_DESTINATION}"
" "
"TARGETS:"
"${args_TARGETS}"
" "
"FILES:"
"${args_FILES}"
)
endfunction()
12 changes: 6 additions & 6 deletions fbgemm_gpu/FbgemmGpu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -712,14 +712,14 @@ target_compile_options(fbgemm_gpu_py PRIVATE
# FBGEMM_GPU Install
################################################################################

install(DESTINATION fbgemm_gpu
TARGETS fbgemm_gpu_py)
install(TARGETS fbgemm_gpu_py
DESTINATION fbgemm_gpu)

install(DESTINATION fbgemm_gpu/split_embedding_codegen_lookup_invokers
FILES ${gen_python_source_files})
install(FILES ${gen_python_source_files}
DESTINATION fbgemm_gpu/split_embedding_codegen_lookup_invokers)

install(DESTINATION fbgemm_gpu/split_embedding_optimizer_codegen
FILES ${gen_defused_optim_py_files})
install(FILES ${gen_defused_optim_py_files}
DESTINATION fbgemm_gpu/split_embedding_optimizer_codegen)

add_custom_target(fbgemm_gpu_py_clean_rpath ALL
WORKING_DIRECTORY ${OUTPUT_DIR}
Expand Down
5 changes: 1 addition & 4 deletions fbgemm_gpu/experimental/example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ gpu_cpp_library(
# Install Shared Library and Python Files
################################################################################

install(DESTINATION fbgemm_gpu/experimental/example
add_to_package(DESTINATION fbgemm_gpu/experimental/example
TARGETS fbgemm_gpu_experimental_example_py
FILES ${experimental_example_python_source_files})

# install(FILES ${experimental_example_python_source_files}
# DESTINATION fbgemm_gpu/experimental/example)
4 changes: 2 additions & 2 deletions fbgemm_gpu/experimental/gemm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ set(experimental_triton_python_source_files
# Install Python Files
################################################################################

install(DESTINATION fbgemm_gpu/experimental/gemm/triton_gemm
FILES ${experimental_triton_python_source_files})
install(FILES ${experimental_triton_python_source_files}
DESTINATION fbgemm_gpu/experimental/gemm/triton_gemm)
2 changes: 1 addition & 1 deletion fbgemm_gpu/experimental/gen_ai/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ gpu_cpp_library(
# Install Shared Library and Python Files
################################################################################

install(DESTINATION fbgemm_gpu/experimental/gen_ai
add_to_package(DESTINATION fbgemm_gpu/experimental/gen_ai
TARGETS fbgemm_gpu_experimental_gen_ai_py
FILES ${experimental_gen_ai_python_source_files})

Expand Down

0 comments on commit 7309648

Please sign in to comment.