Skip to content

Commit 2d6d013

Browse files
committed
fix typo
1 parent 2a05e47 commit 2d6d013

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

paddle/fluid/memory/allocation/npu_pinned_allocator.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void NPUPinnedAllocator::ProcessEventsAndFree() {
3939
}
4040

4141
Allocation *NPUPinnedAllocator::AllocateImpl(size_t size) {
42-
std::lock_guard<std::mutex> lock(mutex_);
42+
std::lock_guard<std::mutex> lock(mtx_);
4343
ProcessEventsAndFree();
4444
void *ptr;
4545
int error = posix_memalign(&ptr, kAlignment, size);
@@ -51,7 +51,7 @@ Allocation *NPUPinnedAllocator::AllocateImpl(size_t size) {
5151
}
5252

5353
void NPUPinnedAllocator::FreeImpl(Allocation *allocation) {
54-
std::lock_guard<std::mutex> lock(mutex_);
54+
std::lock_guard<std::mutex> lock(mtx_);
5555
void *ptr = allocation->ptr();
5656
auto iter = npu_events_.find(allocation);
5757
aclrtEvent event = iter->second;
@@ -67,14 +67,14 @@ void NPUPinnedAllocator::FreeImpl(Allocation *allocation) {
6767
}
6868

6969
uint64_t NPUPinnedAllocator::ReleaseImpl(const platform::Place &place) {
70-
std::lock_guard<std::mutex> lock(mutex_);
70+
std::lock_guard<std::mutex> lock(mtx_);
7171
// Empty implementation
7272
return static_cast<uint64_t>(0);
7373
}
7474

7575
void NPUPinnedAllocator::RecordEvent(Allocation *allocation,
7676
aclrtStream stream) {
77-
std::lock_guard<std::mutex> lock(mutex_);
77+
std::lock_guard<std::mutex> lock(mtx_);
7878
aclrtEvent event = nullptr;
7979
PADDLE_ENFORCE_NPU_SUCCESS(aclrtCreateEvent(&event));
8080
PADDLE_ENFORCE_NPU_SUCCESS(aclrtRecordEvent(event, stream));

0 commit comments

Comments
 (0)