-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Functional] Adds occa::function and occa::array #442
Merged
Merged
Conversation
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
dmed256
force-pushed
the
experimental/function
branch
8 times, most recently
from
January 8, 2021 04:54
8b87967
to
e10edcd
Compare
dmed256
force-pushed
the
experimental/function
branch
from
January 16, 2021 23:59
e10edcd
to
ea65c13
Compare
dmed256
force-pushed
the
experimental/function
branch
2 times, most recently
from
January 17, 2021 05:28
b80af67
to
17bd1ca
Compare
dmed256
force-pushed
the
experimental/function
branch
from
January 17, 2021 05:43
17bd1ca
to
204fd1a
Compare
Codecov Report
@@ Coverage Diff @@
## main #442 +/- ##
==========================================
- Coverage 76.03% 75.02% -1.02%
==========================================
Files 249 250 +1
Lines 18850 19104 +254
==========================================
Hits 14333 14333
- Misses 4517 4771 +254
|
dmed256
changed the title
[Experimental] Adding occa::function
[Functional] Adds occa::function and occa::array
Jan 17, 2021
This was referenced Jan 17, 2021
Closed
This was referenced Jan 20, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updates the
occa::array
to be a type-safe wrapper onocca::memory
with flexible functional methods.occa::function
We introduce a preprocessor macro called
OCCA_FUNCTION
that takes a C++ lambda and returns a typedocca::function
!Example
The
occa::function
template definition is taken fromstd::function
, where a user can define the return and argument types. It's also callable just like anstd::function
occa::array
We introduce a simple wrapper on
occa::memory
which is typed and contains some of the coremap
andreduce
functional methods.Example
Core methods
map
mapTo
forEach
reduce
Reduction
max
min
every
some
Re-indexing
reverse
shiftLeft
shiftRight
Slice/Concat
slice
concat
Utility
fill
cast
Search
find
findIndex
includes
indexOf
lastIndexOf