Skip to content

Commit

Permalink
Merge pull request #116 from LLNL/release/2.1.1
Browse files Browse the repository at this point in the history
Release v2.1.1 (hotfix)
  • Loading branch information
davidbeckingsale authored May 14, 2020
2 parents fff0276 + 6e5c3f9 commit 496911e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
cmake_policy(SET CMP0057 NEW)
cmake_policy(SET CMP0048 NEW)

project(Chai LANGUAGES CXX VERSION 2.1.0)
project(Chai LANGUAGES CXX VERSION 2.1.1)

set(ENABLE_CUDA Off CACHE BOOL "Enable CUDA")
set(ENABLE_HIP Off CACHE BOOL "Enable HIP")
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
# The short X.Y version.
version = u'2.1'
# The full version, including alpha/beta/rc tags.
release = u'2.1.0'
release = u'2.1.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ author = u''
# The short X.Y version.
version = u'2.1'
# The full version, including alpha/beta/rc tags.
release = u'2.1.0'
release = u'2.1.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion scripts/make_release_tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
##############################################################################

TAR_CMD=gtar
VERSION=2.1.0
VERSION=2.1.1

git archive --prefix=chai-${VERSION}/ -o chai-${VERSION}.tar HEAD 2> /dev/null

Expand Down
13 changes: 5 additions & 8 deletions src/chai/ArrayManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ ArrayManager::ArrayManager() :
#if defined(CHAI_ENABLE_PINNED)
#if (defined(CHAI_ENABLE_CUDA) || defined(CHAI_ENABLE_HIP)) && !defined(CHAI_ENABLE_GPU_SIMULATION_MODE)
m_allocators[PINNED] =
new umpire::Allocator(m_resource_manager.getAllocator("HOST"));
new umpire::Allocator(m_resource_manager.getAllocator("PINNED"));
#else
m_allocators[PINNED] =
new umpire::Allocator(m_resource_manager.getAllocator("PINNED"));
new umpire::Allocator(m_resource_manager.getAllocator("HOST"));
#endif
#endif
}
Expand Down Expand Up @@ -161,11 +161,9 @@ void ArrayManager::setExecutionSpace(ExecutionSpace space)
CHAI_LOG(Debug, "Setting execution space to " << space);
std::lock_guard<std::mutex> lock(m_mutex);

#if defined(CHAI_ENABLE_PINNED)
if (chai::GPU == space) {
m_need_sync_for_pinned = true;
m_synced_since_last_kernel = false;
}
#endif

m_current_execution_space = space;
}
Expand Down Expand Up @@ -243,9 +241,8 @@ void ArrayManager::move(PointerRecord* record, ExecutionSpace space)

#if defined(CHAI_ENABLE_PINNED)
if (record->m_last_space == PINNED) {
if (space == CPU && m_need_sync_for_pinned) {
m_need_sync_for_pinned = false;
synchronize();
if (space == CPU) {
syncIfNeeded();
}
return;
}
Expand Down
12 changes: 8 additions & 4 deletions src/chai/ArrayManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,11 @@ class ArrayManager
*/
bool deviceSynchronize() { return m_device_synchronize; }

/*!
* \brief synchronize the device if there hasn't been a synchronize since the last kernel
*/
bool syncIfNeeded();

/*!
* \brief Evicts the data in the given space.
*
Expand Down Expand Up @@ -470,12 +475,11 @@ class ArrayManager
*/
bool m_device_synchronize = false;

#if defined(CHAI_ENABLE_PINNED)
/*!
* Whether or not a synchronize is needed to ensure pinned memory is up to date.
* Whether or not a synchronize has been performed since the launch of the last
* GPU context
*/
bool m_need_sync_for_pinned = false;
#endif
bool m_synced_since_last_kernel = false;
};

} // end of namespace chai
Expand Down
10 changes: 10 additions & 0 deletions src/chai/ArrayManager.inl
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ CHAI_INLINE
void ArrayManager::setAllocator(ExecutionSpace space, umpire::Allocator &allocator) {
*m_allocators[space] = allocator;
}

CHAI_INLINE
bool ArrayManager::syncIfNeeded() {
if (!m_synced_since_last_kernel) {
synchronize();
m_synced_since_last_kernel = true;
return true;
}
return false;
}
} // end of namespace chai

#endif // CHAI_ArrayManager_INL

0 comments on commit 496911e

Please sign in to comment.