@@ -39,7 +39,7 @@ void NPUPinnedAllocator::ProcessEventsAndFree() {
3939}
4040
4141Allocation *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
5353void 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
6969uint64_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
7575void 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