Skip to content

Commit

Permalink
device initialization informational messages only logged if initializ…
Browse files Browse the repository at this point in the history
…ed with quiet=false
  • Loading branch information
evaleev committed Sep 27, 2023
1 parent 957e5cc commit 5ea446b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/TiledArray/external/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <madness/world/thread.h>

#include <TiledArray/error.h>
#include <TiledArray/initialize.h>

#if defined(TILEDARRAY_HAS_CUDA)

Expand Down Expand Up @@ -741,7 +742,7 @@ class Env {
device));
device_concurrent_managed_access_ =
device_concurrent_managed_access_ && concurrent_managed_access;
if (!device_concurrent_managed_access_) {
if (!initialized_to_be_quiet() && !device_concurrent_managed_access_) {
std::cout << "\nWarning: " TILEDARRAY_DEVICE_RUNTIME_STR
" device doesn't support "
"ConcurrentManagedAccess!\n\n";
Expand All @@ -756,8 +757,12 @@ class Env {
}
}

std::cout << "created " << streams_.size()
<< " " TILEDARRAY_DEVICE_RUNTIME_STR " streams" << std::endl;
if (!initialized_to_be_quiet() && world.rank() == 0) {
auto nstreams = streams_.size();
std::cout << "created " << nstreams
<< " " TILEDARRAY_DEVICE_RUNTIME_STR " stream"
<< (nstreams == 1 ? "" : "s") << std::endl;
}

// lastly, set default device for current MPI process's (main) thread
DeviceSafeCall(setDevice(compute_devices_.front()));
Expand Down

0 comments on commit 5ea446b

Please sign in to comment.