summaryrefslogtreecommitdiff
path: root/parallel-libs/streamexecutor/lib/DeviceMemory.cpp
blob: 62b702b8acfd76b2e36fc34a7be5ac0f46ee7b68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//===-- DeviceMemory.cpp - DeviceMemory implementation --------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// Implementation of DeviceMemory class internals.
///
//===----------------------------------------------------------------------===//

#include "streamexecutor/DeviceMemory.h"

#include "streamexecutor/Device.h"

namespace streamexecutor {

GlobalDeviceMemoryBase::~GlobalDeviceMemoryBase() {
  if (Handle) {
    // TODO(jhen): How to handle errors here.
    consumeError(TheDevice->freeDeviceMemory(*this));
  }
}

} // namespace streamexecutor