-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* tmp * fixed linking, binding module name * update readme * add type and device * fix conflict template var with complex.h * update loack * clang * remove lecary test
- Loading branch information
Showing
20 changed files
with
1,239 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,9 @@ authors = [ | |
{ name = "kaihsin", email = "[email protected]" } | ||
] | ||
requires-python = ">=3.10" | ||
dependencies = [] | ||
dependencies = [ | ||
"numpy>=2.2.0", | ||
] | ||
|
||
[tool.scikit-build] | ||
minimum-version = "build-system.requires" | ||
|
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,46 @@ | ||
#ifndef CYTNX_DEVICE_H_ | ||
#define CYTNX_DEVICE_H_ | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
namespace cytnx_core { | ||
|
||
/// @cond | ||
struct __device { | ||
enum __pybind_device { cpu = -1, cuda = 0 }; | ||
}; | ||
|
||
class Device_class { | ||
public: | ||
enum : int { cpu = -1, cuda = 0 }; | ||
int Ngpus; | ||
int Ncpus; | ||
std::vector<std::vector<bool>> CanAccessPeer; | ||
Device_class(); | ||
void print_property(); | ||
std::string getname(const int &device_id); | ||
~Device_class(); | ||
// void cudaDeviceSynchronize(); | ||
}; | ||
/// @endcond | ||
|
||
/** | ||
* @brief data on which devices. | ||
* | ||
* @details This is the variable about the data on which devices .\n | ||
* You can use it as following: | ||
* \code | ||
* int device = Device.cpu; | ||
* \endcode | ||
* The supported enumerations are as following: | ||
* | ||
* enumeration | description | ||
* --------------|-------------------- | ||
* cpu | -1, on cpu | ||
* cuda | 0, on cuda | ||
*/ | ||
extern Device_class Device; | ||
} // namespace cytnx_core | ||
|
||
#endif // CYTNX_DEVICE_H_ |
Oops, something went wrong.