2016-09-03 01:22:42 +08:00
|
|
|
//===-- 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() {
|
2016-09-14 03:25:43 +08:00
|
|
|
if (Handle)
|
2016-09-03 01:22:42 +08:00
|
|
|
// TODO(jhen): How to handle errors here.
|
|
|
|
consumeError(TheDevice->freeDeviceMemory(*this));
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace streamexecutor
|