本文整理汇总了C++中Compute::initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ Compute::initialize方法的具体用法?C++ Compute::initialize怎么用?C++ Compute::initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Compute
的用法示例。
在下文中一共展示了Compute::initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void
ComputeMgr::createCompute(ComputeID i, ComputeMap *map)
{
Compute *c;
PatchID pid2[2];
PatchIDList pids;
int trans2[2];
SimParameters *simParams = Node::Object()->simParameters;
PatchID pid8[8];
int trans8[8];
switch ( map->type(i) )
{
case computeNonbondedSelfType:
#ifdef NAMD_CUDA
register_cuda_compute_self(i,map->computeData[i].pids[0].pid);
#elif defined(NAMD_MIC)
#if MIC_SPLIT_WITH_HOST != 0
if (map->directToDevice(i) == 0) {
c = new ComputeNonbondedSelf(i,map->computeData[i].pids[0].pid,
computeNonbondedWorkArrays,
map->partition(i),map->partition(i)+1,
map->numPartitions(i)); // unknown delete
map->registerCompute(i,c);
c->initialize();
} else {
#endif
register_mic_compute_self(i,map->computeData[i].pids[0].pid,map->partition(i),map->numPartitions(i));
#if MIC_SPLIT_WITH_HOST != 0
}
#endif
#else
c = new ComputeNonbondedSelf(i,map->computeData[i].pids[0].pid,
computeNonbondedWorkArrays,
map->partition(i),map->partition(i)+1,
map->numPartitions(i)); // unknown delete
map->registerCompute(i,c);
c->initialize();
#endif
break;
case computeLCPOType:
for (int j = 0; j < 8; j++) {
pid8[j] = map->computeData[i].pids[j].pid;
trans8[j] = map->computeData[i].pids[j].trans;
}
c = new ComputeLCPO(i,pid8,trans8,
computeNonbondedWorkArrays,
map->partition(i),map->partition(i)+1,
map->numPartitions(i), 8);
map->registerCompute(i,c);
c->initialize();
break;
case computeNonbondedPairType:
pid2[0] = map->computeData[i].pids[0].pid;
trans2[0] = map->computeData[i].pids[0].trans;
pid2[1] = map->computeData[i].pids[1].pid;
trans2[1] = map->computeData[i].pids[1].trans;
#ifdef NAMD_CUDA
register_cuda_compute_pair(i,pid2,trans2);
#elif defined(NAMD_MIC)
#if MIC_SPLIT_WITH_HOST != 0
if (map->directToDevice(i) == 0) {
c = new ComputeNonbondedPair(i,pid2,trans2,
computeNonbondedWorkArrays,
map->partition(i),map->partition(i)+1,
map->numPartitions(i)); // unknown delete
map->registerCompute(i,c);
c->initialize();
} else {
#endif
register_mic_compute_pair(i,pid2,trans2,map->partition(i),map->numPartitions(i));
#if MIC_SPLIT_WITH_HOST != 0
}
#endif
#else
c = new ComputeNonbondedPair(i,pid2,trans2,
computeNonbondedWorkArrays,
map->partition(i),map->partition(i)+1,
map->numPartitions(i)); // unknown delete
map->registerCompute(i,c);
c->initialize();
#endif
break;
#ifdef NAMD_CUDA
case computeNonbondedCUDAType:
c = computeNonbondedCUDAObject = new ComputeNonbondedCUDA(i,this); // unknown delete
map->registerCompute(i,c);
c->initialize();
break;
#endif
#ifdef NAMD_MIC
case computeNonbondedMICType:
c = computeNonbondedMICObject = new ComputeNonbondedMIC(i,this); // unknown delete
map->registerCompute(i,c);
c->initialize();
break;
#endif
case computeExclsType:
//.........这里部分代码省略.........