-
Notifications
You must be signed in to change notification settings - Fork 22
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
Resource Integration #89
Open
mdavis36
wants to merge
136
commits into
develop
Choose a base branch
from
feature/device-context-integration
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,041
−57
Open
Changes from 1 commit
Commits
Show all changes
136 commits
Select commit
Hold shift + click to select a range
808172d
adding camp submodule
mdavis36 ee604ad
Switching camp branch to device, cmake register camp lib
mdavis36 756b5db
Setting up example context test file
mdavis36 71f6f6e
Passing context down to ArrayManager::move
mdavis36 c87454c
passing context to umpire copy
mdavis36 a34f1e7
setting exec space in gpu forall
mdavis36 98a56fc
loop over multiple arrays
davidbeckingsale 877c4cd
ExecutionSpace/Platform equivalence operator.
mdavis36 d7f3e44
Single memory transfer
mdavis36 2c44762
gpu -> cpu transfer, move blocking
mdavis36 fac090e
async copies, segfault on print
mdavis36 61ef0ab
switching to forall loop
mdavis36 9fe6a04
trying to print
mdavis36 1ef9f9d
Tweak context exampel
davidbeckingsale 9f85364
Merge branch 'develop' into feature/device-context-integration
davidbeckingsale 7c20b10
print w & w/o context, remove forall debug output
mdavis36 feaaa51
forcing wait after copy
mdavis36 b30d107
Fixup logging in ManagedArray
davidbeckingsale d877248
Update logging in ArrayManager
davidbeckingsale cc50e35
Merge branch 'feature/device-context-integration' of github.com:LLNL/…
davidbeckingsale ec14672
Add dummy context example
davidbeckingsale f073f76
Move simple more complex
davidbeckingsale 0058134
Cleaning context-integration example code
mdavis36 2344529
Start adding context tests
davidbeckingsale 3de01e2
Removing camp submodule
mdavis36 52b4599
Check if Cuda is enabled before building Cuda Context examples.
mdavis36 26f8d0d
Merge branch 'feature/device-context-integration' of github.com:LLNL/…
davidbeckingsale 73d3557
Context namespace -> Resources
mdavis36 10b2db0
Merge branch 'feature/device-context-integration' of https://github.c…
mdavis36 94cb802
Update simple example
davidbeckingsale e169b4c
Merge branch 'feature/device-context-integration' of github.com:LLNL/…
davidbeckingsale ba87903
Namespace change for tests
mdavis36 99919f7
Example array size and time change
mdavis36 b1ed7ac
Fixing Non Cuda build tests.
mdavis36 33172ef
Fixing no context gpu call
mdavis36 6ecb678
updating umpire
mdavis36 7d85179
Dependent context example.
mdavis36 cab2435
Using context to print on depends example.
mdavis36 eeb9b82
Fixing all example prints.
mdavis36 de9f7b6
New wait_on strategy, first pass.
mdavis36 5897d64
Reducing example array size.
mdavis36 4f0aebc
Change context on CPU space. Fix test Segfault.
mdavis36 1b95c0f
Adding non ManagedArray context example
mdavis36 2f2e578
Example trying to access out of bounds
mdavis36 2365e1e
Updating umpire
mdavis36 5d16eff
Updating Umpire
mdavis36 b3ced7a
Updating Camp with seperated resource/context headers
mdavis36 5926b9e
Using a list of events for handling multi-context management
mdavis36 9b72e0b
Adding multi array/context example and reverting last changes.
mdavis36 1de6885
Working multi context per array
mdavis36 2001912
Clearing active context/resource list on copy
mdavis36 27eadce
Enqueuing waits on stream
mdavis36 a5ca2b5
Merge remote-tracking branch 'origin/develop' into feature/multi-reco…
mdavis36 7e2ffb5
Changing active context list to an array
mdavis36 99ba12d
Merge branch 'develop' into feature/device-context-integration
mdavis36 521505e
Removing commented code for camp submodule
mdavis36 131a986
Merge branch 'feature/device-context-integration' into feature/multi-…
mdavis36 abc8d71
Fixing errors when compiling without Cuda/Hip
mdavis36 5430629
Adding ActiveResourceManager Container class for handling multiple re…
mdavis36 fbc00a2
Updating Umpire
mdavis36 9b07d5d
Updating camp Resource objects
mdavis36 91524d2
Merge branch 'feature/device-context-integration' into feature/multi-…
mdavis36 1a7148d
Bumping umpire
mdavis36 72cfa72
Merge branch 'feature/device-context-integration' into feature/multi-…
mdavis36 a30e67d
Merge branch 'develop' into feature/device-context-integration
mdavis36 bdb7465
Updating Umpire and BLTv0.3.0
mdavis36 f20b59d
Fixing benchmark_api header name change.
mdavis36 6d14af0
Merge branch 'develop' into feature/device-context-integration
mdavis36 1a39b70
Fixing failed tests on Managed_Array_Tests.
mdavis36 9305308
Trying to unify CHAI move
mdavis36 f41551e
Printable callback Types and ExecutionSpaces
mdavis36 00ef5e5
Adding name of array to callback, need to remove later.
mdavis36 bc0177f
More debug statements
mdavis36 13095be
Callbacks for managed_array_resource_tests
mdavis36 6d73a40
Lots of prints for debugging...
mdavis36 d76456b
Change to stop segfaults, incorrect values returned.
mdavis36 b1047b8
Make sure PointerRecord is initialized correctly
davidbeckingsale f0186d4
Bumping Umpire w/ cuda device fix.
mdavis36 8f63be9
Use pinned host memory when possible if GPU enabled.
mdavis36 44101f5
Cleaning up resource examples.
mdavis36 467b43c
Removing print statements from ArrayManager.cpp
mdavis36 234025b
Moving resource example helper header into util.
mdavis36 0ca9c6e
Adding Resource tests.
mdavis36 1c9f650
Re-run tests.
mdavis36 6373598
Merge branch 'develop' into feature/device-context-integration
mdavis36 1914a31
Moving m_pointer_record back.
mdavis36 1385bdd
Pointing Umpire to v3.0.0.
mdavis36 5e11b4d
Removing old debugging code.
mdavis36 99c74d0
Removing include vector.
mdavis36 44a04a4
Removing commented out test.
mdavis36 71f8c45
Merge branch 'develop' into feature/device-context-integration
davidbeckingsale bd3f511
Merge branch 'develop' into feature/device-context-integration
mdavis36 6270fa4
Merge branch 'feature/device-context-integration' into feature/multi-…
mdavis36 ecd991f
Merge branch 'develop' into feature/device-context-integration
mdavis36 bc99917
Merge pull request #93 from LLNL/feature/multi-recource-per-array
davidbeckingsale db37733
merging submodules etc
d66b267
Merge branch 'develop' into feature/device-context-integration
kab163 6f3cf8b
change uberenv to also depend on camp
kab163 0a34106
Merge branch 'feature/device-context-integration' of https://github.c…
kab163 8246998
changing version of camp in CI
kab163 e001520
trying to fix camp in CI...
kab163 c3b06bb
updating from develop
kab163 0f4cea7
had to change the camp version in umpire package too
kab163 103d537
changing the tpl job to also depend on correct camp version
kab163 2188b12
removing the quartz tpl job for now
kab163 ac7167d
resolving conflicts to merge
kab163 d53c05f
Add missing files to CMakeLists.txt
adayton1 54c1f1e
Don't tie CHAI spack package to specific version of CAMP
adayton1 cb5d1e3
Stylistic fixes
adayton1 74a4117
Clean up in unit tests
adayton1 60d254d
Document parameter
adayton1 0a0c745
Fix GPU simulation mode
adayton1 13c4e2f
Fix synchronization for unified/pinned memory
adayton1 cf9a306
Merge branch 'develop' into feature/device-context-integration
adayton1 cc1eee7
Update to RAJA 2022.10.5
adayton1 2bebbf7
Fix typo
adayton1 897f763
More strict checking
adayton1 2a99083
Use default constructor
adayton1 cd5e8a5
Reduce duplicate code
adayton1 3aad2cd
Documentation and clean up
adayton1 79174e2
More cleanup and documentation
adayton1 7b0f907
Document more functions
adayton1 e606ad7
More clean up
adayton1 7691033
More strict checking
adayton1 69a5890
Document variables added to PointerRecord
adayton1 5b7e9df
Remove unnecessary include
adayton1 17478ef
Clean up
adayton1 131654f
Reuse move implementation
adayton1 4844238
Clean up
adayton1 8f4d31a
Clean up move function
adayton1 1b1c735
Clean up
adayton1 e071ca4
Reorder arguments for better intuition
adayton1 87957a5
Fix execution space unit tests
adayton1 1303255
Fix ManagedArray<T>::move argument order
adayton1 a24145a
Add tests back in
adayton1 67b279d
Attempt to fix ExternalConstructorUnowned test
adayton1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Start adding context tests
- Loading branch information
commit 2344529cd59eec84057ad0fb227afb6ee7ae7637
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
////////////////////////////////////////////////////////////////////////////// | ||
// Copyright (c) 2016-19, Lawrence Livermore National Security, LLC and CHAI | ||
// project contributors. See the COPYRIGHT file for details. | ||
// | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
////////////////////////////////////////////////////////////////////////////// | ||
#include "gtest/gtest.h" | ||
|
||
#define GPU_TEST(X, Y) \ | ||
static void gpu_test_##X##Y(); \ | ||
TEST(X, Y) { gpu_test_##X##Y(); } \ | ||
static void gpu_test_##X##Y() | ||
|
||
#include "../src/util/forall.hpp" | ||
|
||
#include "chai/ManagedArray.hpp" | ||
#include "chai/config.hpp" | ||
|
||
GPU_TEST(ManagedArray, Simple) | ||
{ | ||
constexpr std::size_t ARRAY_SIZE{1024}; | ||
|
||
camp::devices::Context host{camp::devices::Host{}}; | ||
camp::devices::Context device{camp::devices::Cuda{}}; | ||
|
||
chai::ManagedArray<double> array(ARRAY_SIZE); | ||
|
||
forall(&host, 0, ARRAY_SIZE, [=] __host__ __device__ (int i) { | ||
array[i] = i; | ||
}); | ||
|
||
forall(&device, 0, ARRAY_SIZE, [=] __host__ __device__ (int i) { | ||
array[i] = array[i] * 2.0; | ||
}); | ||
|
||
// print on host | ||
forall(&host, 0, ARRAY_SIZE, [=] __host__ __device__ (int i) { | ||
EXPECT_DOUBLE_EQ(array[i], i*2.0); | ||
}); | ||
} | ||
|
||
GPU_TEST(ManagedArray, SimpleWithAsyncMoveFrom) | ||
{ | ||
constexpr std::size_t ARRAY_SIZE{1024}; | ||
|
||
camp::devices::Context host{camp::devices::Host{}}; | ||
camp::devices::Context device{camp::devices::Cuda{}}; | ||
|
||
chai::ManagedArray<double> array(ARRAY_SIZE); | ||
|
||
forall(&host, 0, ARRAY_SIZE, [=] __host__ __device__ (int i) { | ||
array[i] = i; | ||
}); | ||
|
||
forall(&device, 0, ARRAY_SIZE, [=] __host__ __device__ (int i) { | ||
array[i] = array[i] * 2.0; | ||
}); | ||
|
||
array.move(chai::CPU, &device); | ||
|
||
// print on host | ||
forall(&host, 0, ARRAY_SIZE, [=] __host__ __device__ (int i) { | ||
EXPECT_DOUBLE_EQ(array[i], i*2.0); | ||
}); | ||
} | ||
|
||
GPU_TEST(ManagedArray, SimpleWithAsyncMoveTo) | ||
{ | ||
constexpr std::size_t ARRAY_SIZE{1024}; | ||
|
||
camp::devices::Context host{camp::devices::Host{}}; | ||
camp::devices::Context device{camp::devices::Cuda{}}; | ||
|
||
chai::ManagedArray<double> array(ARRAY_SIZE); | ||
|
||
forall(&host, 0, ARRAY_SIZE, [=] __host__ __device__ (int i) { | ||
array[i] = i; | ||
}); | ||
|
||
array.move(chai::GPU, &device); | ||
|
||
forall(&device, 0, ARRAY_SIZE, [=] __host__ __device__ (int i) { | ||
array[i] = array[i] * 2.0; | ||
}); | ||
|
||
// print on host | ||
forall(&host, 0, ARRAY_SIZE, [=] __host__ __device__ (int i) { | ||
EXPECT_DOUBLE_EQ(array[i], i*2.0); | ||
}); | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
if (CHAI_ENABLE_CUDA || CHAI_ENABLE_HIP)
?