Skip to content
Open
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/



Expand Down Expand Up @@ -645,4 +645,4 @@ FodyWeavers.xsd
*.msp

# JetBrains Rider
*.sln.iml
*.sln.iml
57 changes: 53 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,61 @@
#cmake_minimum_required(VERSION 3.23 FATAL_ERROR)
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
# cmake version 3.23 or higher is needed to support
# the argument CUDA_ARCHITECTURES all-major
cmake_minimum_required(VERSION 3.23 FATAL_ERROR)

project(leapct)
project(leapct LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

ENABLE_TESTING()
# Find a default GPU accelerator language.
set(_default_accelerator_type "None")
include(CheckLanguage)
check_language(HIP)
if(CMAKE_HIP_COMPILER)
set(_default_accelerator_type "AMD")
endif()
check_language(CUDA)
if(CMAKE_CUDA_COMPILER)
set(_default_accelerator_type "NVIDIA")
endif()

set(LEAP_GPU "$_default_accelerator_type" CACHE STRING "GPU acceleration type")
unset(_default_accelerator_type)

set_property(CACHE LEAP_GPU PROPERTY STRINGS "NVIDIA" "AMD" "None")
# Extract "STRINGS" property of the parameter
get_property(OPT_STRINGS CACHE LEAP_GPU PROPERTY STRINGS)
# Check that value of the parameter is inside "STRINGS" list.
if (NOT LEAP_GPU IN_LIST OPT_STRINGS)
message(FATAL_ERROR "Wrong value of the parameter 'LEAP_GPU': ${LEAP_GPU}")
endif ()
message(STATUS "LEAP_GPU selected accelerator type ${LEAP_GPU}")

string(TOUPPER "${LEAP_GPU}" LEAP_GPU)
if (LEAP_GPU STREQUAL "NVIDIA")
# To minimize binary size and compile time, users are suggested to
# set the CUDAARCHS environment variable or define the CMake variable CMAKE_CUDA_ARCHITECTURES
# to "native" if building specifically for the GPU visible to the build environment,
# or to an explicit numerical architecture code, such as "70"
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES all-major)
endif()
enable_language(CUDA)
set(LEAP_CUDA ON)
elseif (LEAP_GPU STREQUAL "AMD")
# Users are advised to set CMAKE_HIP_ARCHITECTURES to a minimal subset.
# See also https://rocm.docs.amd.com/en/latest/conceptual/cmake-packages.html#using-hip-in-cmake
enable_language(HIP)
set(LEAP_HIP ON)
elseif (LEAP_GPU STREQUAL "NONE")
set(LEAP_CPU_ONLY ON)
else ()
message(FATAL_ERROR "CMake scripting error: ${LEAP_GPU} didn't match.")
endif ()

if((BUILD_TESTING) OR (NOT DEFINED BUILD_TESTING))
ENABLE_TESTING()
endif()

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
Expand Down
44 changes: 44 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[build-system]
requires = ["scikit-build-core>=0.10"]
build-backend = "scikit_build_core.build"

[project]
name = "leapct"
dynamic = ["version"]
description = "LivermorE AI Projector for Computed Tomography (LEAPCT)"
authors = [
{ name = "Kyle Champley", email = "champley@gmail.com" },
{ name = "Hyojin Kim", email = "hkim@llnl.gov" }
]
readme = "README.md"
license-files = ["LICENSE"]
keywords = [
"Machine Learning", "ML", "AI", "Computed Tomography", "CT",
"Differentiable Project", "Forward Project", "Back Project"
]
requires-python = ">=3.6"
dependencies = [
"imageio",
"matplotlib",
"numpy",
"scipy",
]

[tool.scikit-build]
minimum-version = "build-system.requires"
cmake.version = ">=3.23"
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"

wheel.packages = ["src/leap_filter_sequence", "src/leap_preprocessing_algorithms", "src/leapctype", "src/leaptorch"]
wheel.py-api = "py3"
# If we have to issue revised packages for the same software version,
# we can increment a build number:
wheel.build-tag = 0

[tool.scikit-build.cmake.define]
BUILD_TESTING = false
LEAP_GPU = "NVIDIA"

[tool.setuptools_scm]
# There are several packages. Is there an appropriate place to put a package version?
#write_to = "src/leap/_version.py"
4 changes: 0 additions & 4 deletions setup.cfg

This file was deleted.

141 changes: 0 additions & 141 deletions setup.py

This file was deleted.

Loading