-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from Kubiczek36/dev_pycpufit
Dev_pycpufit
- Loading branch information
Showing
17 changed files
with
843 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
# Python | ||
|
||
# Python package | ||
|
||
set( build_directory "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/pyCpufit" ) | ||
set( setup_files | ||
"${CMAKE_CURRENT_SOURCE_DIR}/README.txt" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/setup.py" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/setup.cfg" | ||
) | ||
set( module_directory "${build_directory}/pycpufit" ) | ||
set( module_files | ||
"${CMAKE_CURRENT_SOURCE_DIR}/pycpufit/__init__.py" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/pycpufit/cpufit.py" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/pycpufit/version.py" | ||
) | ||
|
||
|
||
set( binary $<TARGET_FILE:Cpufit> ) | ||
|
||
|
||
add_custom_target( PYTHON_PACKAGE_CPUFIT | ||
COMMAND ${CMAKE_COMMAND} -E | ||
remove_directory ${build_directory} | ||
COMMAND ${CMAKE_COMMAND} -E | ||
make_directory ${build_directory} | ||
COMMAND ${CMAKE_COMMAND} -E | ||
copy_if_different ${setup_files} ${build_directory} | ||
COMMAND ${CMAKE_COMMAND} -E | ||
make_directory ${module_directory} | ||
COMMAND ${CMAKE_COMMAND} -E | ||
copy_if_different ${module_files} ${module_directory} | ||
COMMAND ${CMAKE_COMMAND} -E | ||
copy_if_different ${binary} ${module_directory} | ||
) | ||
|
||
set_property( TARGET PYTHON_PACKAGE_CPUFIT PROPERTY FOLDER CMakePredefinedTargets ) | ||
add_dependencies( PYTHON_PACKAGE_CPUFIT Cpufit ) | ||
|
||
if( NOT PYTHONINTERP_FOUND ) | ||
message( STATUS "Python NOT found - skipping creation of Python wheel!" ) | ||
return() | ||
endif() | ||
|
||
# Python wheel (output name is incorrect, requires plattform tag, see packaging) | ||
|
||
add_custom_target( PYTHON_WHEEL_CPUFIT ALL | ||
COMMAND ${CMAKE_COMMAND} -E | ||
chdir ${build_directory} "${PYTHON_EXECUTABLE}" setup.py clean --all | ||
COMMAND ${CMAKE_COMMAND} -E | ||
chdir ${build_directory} "${PYTHON_EXECUTABLE}" setup.py bdist_wheel | ||
COMMENT "Preparing Python Wheel" | ||
) | ||
set_property( TARGET PYTHON_WHEEL_CPUFIT PROPERTY FOLDER CMakePredefinedTargets ) | ||
add_dependencies( PYTHON_WHEEL_CPUFIT PYTHON_PACKAGE_CPUFIT ) | ||
|
||
# add launcher to Python package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Python binding for the [Cpufit library](https://github.com/gpufit/Gpufit) which implements Levenberg Marquardt curve fitting in CUDA | ||
|
||
Requirements | ||
|
||
- Windows | ||
- Python 2 or 3 with NumPy | ||
|
||
Installation | ||
|
||
Currently the wheel file has to be installed locally. | ||
|
||
If NumPy is not yet installed, install it using pip from the command line | ||
|
||
pip install numpy | ||
|
||
Then install pyCpufit from the local folder via: | ||
|
||
pip install --no-index --find-links=LocalPathToWheelFile pyCpufit | ||
|
||
Examples | ||
|
||
See project-root/examples/python folder. **Cpufit** examples begin with `cpufit_`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from cpufit import * |
Oops, something went wrong.