https://github.com/Microsoft/CNTK
Raw File
Tip revision: 3a4e3a1bc7b41fe5620dd3a592b83ee61002d4f2 authored by thhoens on 28 June 2016, 23:19:49 UTC
Removed prints
Tip revision: 3a4e3a1
CUDAPageLockedMemAllocator.h
#pragma once

#include "MemAllocator.h"

namespace Microsoft { namespace MSR { namespace CNTK {

#ifdef _WIN32
#ifdef MATH_EXPORTS
#define MATH_API __declspec(dllexport)
#else
#define MATH_API __declspec(dllimport)
#endif
#else // no DLLs on Linux
#define MATH_API
#endif

class MATH_API CUDAPageLockedMemAllocator : public MemAllocator
{
public:
    CUDAPageLockedMemAllocator(int deviceID);

    int GetDeviceId() const;
    void* Malloc(size_t size) override;
    void Free(void* p) override;
    static void* Malloc(size_t size, int deviceId);
    static void Free(void* p, int deviceId);

private:
    int m_deviceID;
};
} } }
back to top