-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea25771
commit e87d59d
Showing
13 changed files
with
332 additions
and
250 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -5,4 +5,5 @@ furo==2022.9.29 | |
pydata-sphinx-theme==0.11.0 | ||
numpydoc==1.5.0 | ||
sphinx-panels==0.6.0 | ||
regex | ||
regex | ||
sphinx-favicon |
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,50 @@ | ||
Caution | ||
####### | ||
|
||
.. warning:: | ||
|
||
LibRapid developers had to make certain decisions regarding the underlying data layout used by the library. We made | ||
these decisions with the best interests of the library in mind, and while they may improve performance or usability, | ||
they may also incur adverse side effects. | ||
|
||
While the developers of LibRapid may not be aware of all the side effects of their design choices, we have done our | ||
best to identify and justify those we know of. | ||
|
||
Array Referencing Issues | ||
------------------------ | ||
|
||
LibRapid uses lazy evaluation to reduce the number of intermediate variables and copies required for any given | ||
operation, significantly improving performance. A side effect of this is that combined operations store references to | ||
Array objects. | ||
|
||
As a result, if any of the referenced Array instances go out of scope before the lazy object is evaluated, an invalid | ||
memory location will be accessed, incurring a segmentation fault. | ||
|
||
The easiest fix for this is to make sure you evaluate temporary results in time, though this is easier said than done. | ||
LibRapid aims to identify when a lazy object is using an invalid value and notify the user, but this will not work in | ||
all cases. | ||
|
||
The code below will cause a segmentation fault since ``testArray`` will go out of scope upon returning from the function | ||
while the returned object contains two references to the array. | ||
|
||
.. code-block:: cpp | ||
:linenos: | ||
/* References invalid memory | ||
vvvv */ | ||
auto doesThisBreak() { | ||
lrc::Array<float> testArray(lrc::Shape({3, 3})); | ||
testArray << 1, 2, 3, 4, 5, 6, 7, 8, 9; | ||
return testArray + testArray; | ||
} | ||
.. code-block:: cpp | ||
:linenos: | ||
/* Changed | ||
-------vvv------- */ | ||
lrc::Array<float> doesThisBreak() { | ||
lrc::Array<float> testArray(lrc::Shape({3, 3})); | ||
testArray << 1, 2, 3, 4, 5, 6, 7, 8, 9; | ||
return testArray + testArray; | ||
} |
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,33 @@ | ||
CMake Integration | ||
################# | ||
|
||
Installation | ||
------------ | ||
|
||
Link librapid like any other CMake library: | ||
|
||
Clone the repository: | ||
``git clone --recursive https://github.com/LibRapid/libRapid.git`` | ||
|
||
Add the following to your ``CMakeLists.txt`` | ||
|
||
.. code-block:: cmake | ||
add_subdirectory(librapid) | ||
target_link_libraries(yourTarget PUBLIC librapid) | ||
CMake Options | ||
------------- | ||
|
||
When using LibRapid in your CMake project, the following options are configurable: | ||
|
||
- ``LIBRAPID_BUILD_EXAMPLES => OFF`` (Build examples?) | ||
- ``LIBRAPID_BUILD_TESTS => OFF`` (Build tests?) | ||
- ``LIBRAPID_STRICT => OFF`` (Force warnings into errors?) | ||
- ``LIBRAPID_QUIET => OFF`` (Disable warnings) | ||
- ``LIBRAPID_GET_BLAS => OFF`` (Clone a prebuilt version of OpenBLAS?) | ||
- ``LIBRAPID_USE_CUDA => ON`` (Automatically search for CUDA?) | ||
- ``LIBRAPID_USE_OMP => ON`` (Automatically search for OpenMP?) | ||
- ``LIBRAPID_USE_MULTIPREC => OFF`` (Include multiprecision library -- more on this elsewhere in documentation) | ||
- ``LIBRAPID_OPTIMISE_SMALL_ARRAYS => OFF`` (Optimise small arrays?) | ||
- ``LIBRAPID_FAST_MATH => OFF`` (Use potentially less accurate operations to increase performance) |
Oops, something went wrong.