本文整理汇总了C++中cluster_seedgen函数的典型用法代码示例。如果您正苦于以下问题:C++ cluster_seedgen函数的具体用法?C++ cluster_seedgen怎么用?C++ cluster_seedgen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cluster_seedgen函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CUDA_CHECK
void Dragon::set_device(const int device_id) {
int current_device;
CUDA_CHECK(cudaGetDevice(¤t_device));
if (current_device == device_id) return;
// The call to cudaSetDevice must come before any calls to Get, which
// may perform initialization using the GPU.
// reset Device must reset handle and generator???
CUDA_CHECK(cudaSetDevice(device_id));
if (Get().cublas_handle) cublasDestroy_v2(Get().cublas_handle);
if (Get().curand_generator) curandDestroyGenerator(Get().curand_generator);
cublasCreate_v2(&Get().cublas_handle);
curandCreateGenerator(&Get().curand_generator, CURAND_RNG_PSEUDO_DEFAULT);
curandSetPseudoRandomGeneratorSeed(Get().curand_generator, cluster_seedgen());
}
开发者ID:wangxianliang,项目名称:Dragon,代码行数:15,代码来源:common.cpp
示例2: cublas_handle_
Engine::Engine()
: cublas_handle_(NULL), curand_generator_(NULL), random_generator_(),
mode_(Engine::CPU) {
// Try to create a cublas handler, and report an error if failed (but we will
// keep the program running as one might just want to run CPU code).
if (cublasCreate(&cublas_handle_) != CUBLAS_STATUS_SUCCESS) {
LOG(ERROR) << "Cannot create Cublas handle. Cublas won't be available.";
}
// Try to create a curand handler.
if (curandCreateGenerator(&curand_generator_, CURAND_RNG_PSEUDO_DEFAULT)
!= CURAND_STATUS_SUCCESS ||
curandSetPseudoRandomGeneratorSeed(curand_generator_, cluster_seedgen())
!= CURAND_STATUS_SUCCESS) {
LOG(ERROR) << "Cannot create Curand generator. Curand won't be available.";
}
}
开发者ID:airxcy,项目名称:ITF_Tracker,代码行数:16,代码来源:common.cpp
示例3: CUDA_CHECK
void Caffe::SetDevice(const int device_id) {
int current_device;
CUDA_CHECK(cudaGetDevice(¤t_device));
if (current_device == device_id) {
return;
}
if (Get().cublas_handle_) CUBLAS_CHECK(cublasDestroy(Get().cublas_handle_));
if (Get().curand_generator_) {
CURAND_CHECK(curandDestroyGenerator(Get().curand_generator_));
}
CUDA_CHECK(cudaSetDevice(device_id));
CUBLAS_CHECK(cublasCreate(&Get().cublas_handle_));
CURAND_CHECK(curandCreateGenerator(&Get().curand_generator_,
CURAND_RNG_PSEUDO_DEFAULT));
CURAND_CHECK(curandSetPseudoRandomGeneratorSeed(Get().curand_generator_,
cluster_seedgen()));
}
开发者ID:FuchenUSTC,项目名称:caffe-c3d,代码行数:17,代码来源:common.cpp
示例4: CUDA_CHECK
void Engine::SetDevice(const int device_id) {
int current_device;
CUDA_CHECK(cudaGetDevice(¤t_device));
if (current_device == device_id) {
return;
}
// The call to cudaSetDevice must come before any calls to Get, which
// may perform initialization using the GPU.
CUDA_CHECK(cudaSetDevice(device_id));
if (Get().cublas_handle_) CUBLAS_CHECK(cublasDestroy(Get().cublas_handle_));
if (Get().curand_generator_) {
CURAND_CHECK(curandDestroyGenerator(Get().curand_generator_));
}
CUBLAS_CHECK(cublasCreate(&Get().cublas_handle_));
CURAND_CHECK(curandCreateGenerator(&Get().curand_generator_,
CURAND_RNG_PSEUDO_DEFAULT));
CURAND_CHECK(curandSetPseudoRandomGeneratorSeed(Get().curand_generator_,
cluster_seedgen()));
}
开发者ID:airxcy,项目名称:ITF_Tracker,代码行数:19,代码来源:common.cpp
示例5: CUDA_CHECK
void Caffe::SetSlaveDevice(const int slave_device_id) {
int current_device;
CUDA_CHECK(cudaGetDevice(¤t_device));
if (current_device == slave_device_id) {
return;
}
if (Get().slave_cublas_handle_) CUBLAS_CHECK(cublasDestroy(Get().slave_cublas_handle_));
if (Get().slave_curand_generator_) {
CURAND_CHECK(curandDestroyGenerator(Get().slave_curand_generator_));
}
CUDA_CHECK(cudaSetDevice(slave_device_id));
CUDA_CHECK(cudaStreamCreate (&Get().slave_cu_stream_));
CUBLAS_CHECK(cublasCreate(&Get().slave_cublas_handle_));
CUBLAS_CHECK(cublasSetStream(Get().slave_cublas_handle_, Get().slave_cu_stream_));
CURAND_CHECK(curandCreateGenerator(&Get().slave_curand_generator_,
CURAND_RNG_PSEUDO_DEFAULT));
CURAND_CHECK(curandSetPseudoRandomGeneratorSeed(Get().slave_curand_generator_,
cluster_seedgen()));
Get().slave_device_id_ = slave_device_id;
CUDA_CHECK(cudaSetDevice(current_device));
Caffe::set_gpu_mode(Caffe::MASTER_SLAVE);
}
开发者ID:SophieZhou,项目名称:caffe-multilabel,代码行数:22,代码来源:common.cpp
示例6: Get
void Caffe::SetDevice(const int device_id) {
std::vector<int> devices;
devices.push_back(device_id);
Caffe::SetDevices(devices);
Get().default_device_context_ = GetDeviceContext(device_id);
if (Get().default_device_context_->backend() == Backend::BACKEND_CUDA) {
#ifdef USE_CUDA
int current_device;
CUDA_CHECK(cudaGetDevice(¤t_device));
if (current_device == device_id) {
return;
}
// The call to cudaSetDevice must come before any calls to Get, which
// may perform initialization using the GPU.
CUDA_CHECK(cudaSetDevice(device_id));
if (Get().cublas_handle_)
CUBLAS_CHECK(cublasDestroy(Get().cublas_handle_));
if (Get().curand_generator_) {
CURAND_CHECK(curandDestroyGenerator(Get().curand_generator_));
}
CUBLAS_CHECK(cublasCreate(&Get().cublas_handle_));
CURAND_CHECK(
curandCreateGenerator(&Get().curand_generator_,
CURAND_RNG_PSEUDO_DEFAULT));
CURAND_CHECK(
curandSetPseudoRandomGeneratorSeed(Get().curand_generator_,
cluster_seedgen()));
#endif // USE_CUDA
} else {
#ifdef USE_GREENTEA
#ifdef USE_CLBLAS
clblasSetup();
#endif // USE_CLBLAS
#endif // USE_GREENTEA
}
}
开发者ID:aharrison24,项目名称:caffe,代码行数:38,代码来源:common.cpp
示例7: mode_
Caffe::Caffe()
: mode_(Caffe::CPU), phase_(Caffe::TRAIN), cublas_handle_(NULL),
curand_generator_(NULL),
random_generator_(),
slave_cublas_handle_(NULL),
slave_curand_generator_(NULL),
master_device_id_(0), slave_device_id_(-1),
cu_stream_(NULL),slave_cu_stream_(NULL),
current_cu_stream_(NULL){
// Try to create a cublas handler, and report an error if failed (but we will
// keep the program running as one might just want to run CPU code).
if (cublasCreate(&cublas_handle_) != CUBLAS_STATUS_SUCCESS) {
LOG(ERROR) << "Cannot create Cublas handle. Cublas won't be available.";
}
// Try to create a curand handler.
if (curandCreateGenerator(&curand_generator_, CURAND_RNG_PSEUDO_DEFAULT)
!= CURAND_STATUS_SUCCESS ||
curandSetPseudoRandomGeneratorSeed(curand_generator_, cluster_seedgen())
!= CURAND_STATUS_SUCCESS) {
LOG(ERROR) << "Cannot create Curand generator. Curand won't be available.";
}
}
开发者ID:SophieZhou,项目名称:caffe-multilabel,代码行数:24,代码来源:common.cpp
示例8: cublas_handle_
Caffe::Caffe()
:
#ifdef USE_CUDA
cublas_handle_(NULL),
curand_generator_(NULL),
#endif // USE_CUDA
random_generator_(),
mode_(Caffe::CPU),
default_device_context_(nullptr) {
// Try to create a cublas handler, and report an error if failed (but we will
// keep the program running as one might just want to run CPU code).
#ifdef USE_CUDA
if (cublasCreate(&cublas_handle_) != CUBLAS_STATUS_SUCCESS) {
LOG(ERROR)<< "Cannot create Cublas handle. Cublas won't be available.";
}
// Try to create a curand handler.
if (curandCreateGenerator(&curand_generator_, CURAND_RNG_PSEUDO_DEFAULT)
!= CURAND_STATUS_SUCCESS ||
curandSetPseudoRandomGeneratorSeed(curand_generator_, cluster_seedgen())
!= CURAND_STATUS_SUCCESS) {
LOG(ERROR) << "Cannot create Curand generator. Curand won't be available.";
}
#endif // USE_CUDA
}
开发者ID:aharrison24,项目名称:caffe,代码行数:24,代码来源:common.cpp
示例9: Generator
Generator() : rng_(new itf::rng_t(cluster_seedgen())) {}
开发者ID:airxcy,项目名称:ITF_Tracker,代码行数:1,代码来源:common.cpp
示例10: Generator
Generator() : rng_(new caffe::rng_t(cluster_seedgen())) {}
开发者ID:Caffe-MPI,项目名称:Caffe-MPI.github.io,代码行数:1,代码来源:common.cpp
注:本文中的cluster_seedgen函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论