moved DeviceFromConfig() for CPUONLY mode back to BestGpu.h since it otherwise caused link errors for reader projects that did not include BestGpu.cpp;
.CU files now include BestGpu.h to get access to CPUONLY flag; CPUONLY mode set from BestGpu.h now compiles in VS with SDK installed
This commit is contained in:
Родитель
b2d77c5d8b
Коммит
35e2211147
|
@ -6,8 +6,13 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// #define CPUONLY // #define this to build without GPU support nor needing the SDK installed
|
||||
#define CPUONLY // #define this to build without GPU support nor needing the SDK installed
|
||||
|
||||
namespace Microsoft { namespace MSR { namespace CNTK {
|
||||
#ifndef CPUONLY
|
||||
short DeviceFromConfig(const class ConfigParameters& config);
|
||||
#else
|
||||
static inline short DeviceFromConfig(const class ConfigParameters& /*config*/) { return -1/*CPUDEVICE*/; } // tells runtime system to not try to use GPUs
|
||||
// TODO: find a way to use CPUDEVICE without a huge include overhead; OK so far since CPUONLY mode is sorta special...
|
||||
#endif
|
||||
}}}
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
// </copyright>
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "BestGpu.h"
|
||||
|
||||
#ifndef CPUONLY
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "cublas_v2.h"
|
||||
#include <assert.h>
|
||||
#include <cuda.h>
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
// </copyright>
|
||||
//
|
||||
|
||||
#include "BestGpu.h"
|
||||
|
||||
#ifndef CPUONLY
|
||||
|
||||
#include <float.h>
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
// </copyright>
|
||||
//
|
||||
|
||||
#include "BestGpu.h"
|
||||
|
||||
#ifndef CPUONLY
|
||||
|
||||
#include "GPUSparseMatrix.h"
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
// </copyright>
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "BestGpu.h"
|
||||
|
||||
#ifndef CPUONLY
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "GPUWatcher.h"
|
||||
#include <cuda.h>
|
||||
#include <cuda_runtime.h>
|
||||
|
|
2005
Math/Math/NoGPU.cpp
2005
Math/Math/NoGPU.cpp
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче