Skip to content

Commit 496911e

Browse files
Merge pull request #116 from LLNL/release/2.1.1
Release v2.1.1 (hotfix)
2 parents fff0276 + 6e5c3f9 commit 496911e

File tree

7 files changed

+27
-16
lines changed

7 files changed

+27
-16
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
cmake_policy(SET CMP0057 NEW)
88
cmake_policy(SET CMP0048 NEW)
99

10-
project(Chai LANGUAGES CXX VERSION 2.1.0)
10+
project(Chai LANGUAGES CXX VERSION 2.1.1)
1111

1212
set(ENABLE_CUDA Off CACHE BOOL "Enable CUDA")
1313
set(ENABLE_HIP Off CACHE BOOL "Enable HIP")

docs/sphinx/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
# The short X.Y version.
6464
version = u'2.1'
6565
# The full version, including alpha/beta/rc tags.
66-
release = u'2.1.0'
66+
release = u'2.1.1'
6767

6868
# The language for content autogenerated by Sphinx. Refer to documentation
6969
# for a list of supported languages.

docs/sphinx/conf.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ author = u''
6262
# The short X.Y version.
6363
version = u'2.1'
6464
# The full version, including alpha/beta/rc tags.
65-
release = u'2.1.0'
65+
release = u'2.1.1'
6666

6767
# The language for content autogenerated by Sphinx. Refer to documentation
6868
# for a list of supported languages.

scripts/make_release_tarball.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
##############################################################################
88

99
TAR_CMD=gtar
10-
VERSION=2.1.0
10+
VERSION=2.1.1
1111

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

src/chai/ArrayManager.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ ArrayManager::ArrayManager() :
5656
#if defined(CHAI_ENABLE_PINNED)
5757
#if (defined(CHAI_ENABLE_CUDA) || defined(CHAI_ENABLE_HIP)) && !defined(CHAI_ENABLE_GPU_SIMULATION_MODE)
5858
m_allocators[PINNED] =
59-
new umpire::Allocator(m_resource_manager.getAllocator("HOST"));
59+
new umpire::Allocator(m_resource_manager.getAllocator("PINNED"));
6060
#else
6161
m_allocators[PINNED] =
62-
new umpire::Allocator(m_resource_manager.getAllocator("PINNED"));
62+
new umpire::Allocator(m_resource_manager.getAllocator("HOST"));
6363
#endif
6464
#endif
6565
}
@@ -161,11 +161,9 @@ void ArrayManager::setExecutionSpace(ExecutionSpace space)
161161
CHAI_LOG(Debug, "Setting execution space to " << space);
162162
std::lock_guard<std::mutex> lock(m_mutex);
163163

164-
#if defined(CHAI_ENABLE_PINNED)
165164
if (chai::GPU == space) {
166-
m_need_sync_for_pinned = true;
165+
m_synced_since_last_kernel = false;
167166
}
168-
#endif
169167

170168
m_current_execution_space = space;
171169
}
@@ -243,9 +241,8 @@ void ArrayManager::move(PointerRecord* record, ExecutionSpace space)
243241

244242
#if defined(CHAI_ENABLE_PINNED)
245243
if (record->m_last_space == PINNED) {
246-
if (space == CPU && m_need_sync_for_pinned) {
247-
m_need_sync_for_pinned = false;
248-
synchronize();
244+
if (space == CPU) {
245+
syncIfNeeded();
249246
}
250247
return;
251248
}

src/chai/ArrayManager.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,11 @@ class ArrayManager
368368
*/
369369
bool deviceSynchronize() { return m_device_synchronize; }
370370

371+
/*!
372+
* \brief synchronize the device if there hasn't been a synchronize since the last kernel
373+
*/
374+
bool syncIfNeeded();
375+
371376
/*!
372377
* \brief Evicts the data in the given space.
373378
*
@@ -470,12 +475,11 @@ class ArrayManager
470475
*/
471476
bool m_device_synchronize = false;
472477

473-
#if defined(CHAI_ENABLE_PINNED)
474478
/*!
475-
* Whether or not a synchronize is needed to ensure pinned memory is up to date.
479+
* Whether or not a synchronize has been performed since the launch of the last
480+
* GPU context
476481
*/
477-
bool m_need_sync_for_pinned = false;
478-
#endif
482+
bool m_synced_since_last_kernel = false;
479483
};
480484

481485
} // end of namespace chai

src/chai/ArrayManager.inl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ CHAI_INLINE
112112
void ArrayManager::setAllocator(ExecutionSpace space, umpire::Allocator &allocator) {
113113
*m_allocators[space] = allocator;
114114
}
115+
116+
CHAI_INLINE
117+
bool ArrayManager::syncIfNeeded() {
118+
if (!m_synced_since_last_kernel) {
119+
synchronize();
120+
m_synced_since_last_kernel = true;
121+
return true;
122+
}
123+
return false;
124+
}
115125
} // end of namespace chai
116126

117127
#endif // CHAI_ArrayManager_INL

0 commit comments

Comments
 (0)