本文整理汇总了C++中kokkos::View::dimension方法的典型用法代码示例。如果您正苦于以下问题:C++ View::dimension方法的具体用法?C++ View::dimension怎么用?C++ View::dimension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kokkos::View
的用法示例。
在下文中一共展示了View::dimension方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
FieldContainer_Kokkos(Kokkos::View<ScalarPoindex_typeer,Kokkos::LayoutLeft,Kokkos::OpenMP>& InContainer){
dim0=dim[0]=InContainer.dimension(0);
dim1=dim[1]=InContainer.dimension(1);
dim2=dim[2]=InContainer.dimension(2);
dim3=dim[3]=InContainer.dimension(3);
dim4=dim[4]=InContainer.dimension(4);
dim5=dim[5]=InContainer.dimension(5);
dim6=dim[6]=InContainer.dimension(6);
dim7=dim[7]=InContainer.dimension(7);
rankValue=Kokkos::View<ScalarPoindex_typeer,Kokkos::LayoutLeft,Kokkos::OpenMP>::Rank;
intepidManaged=false;
switch(rankValue){
case 1:
sizeValue=dim0;
break;
case 2:
sizeValue=dim0*dim1;
break;
case 3:
sizeValue=dim0*dim1*dim2;
break;
case 4:
sizeValue=dim0*dim1*dim2*dim3;
break;
case 5:
sizeValue=dim0*dim1*dim2*dim3*dim4;
break;
case 6:
sizeValue=dim0*dim1*dim2*dim3*dim4*dim5;
break;
case 7:
sizeValue=dim0*dim1*dim2*dim3*dim4*dim5*dim6;
break;
case 8:
sizeValue=dim0*dim1*dim2*dim3*dim4*dim5*dim6*dim7;
break;
}
containerMemory=InContainer.ptr_on_device();
}
示例2: GEMM
static void GEMM(Teuchos::ETransp transA, Teuchos::ETransp transB, Scalar alpha,
Kokkos::View<Scalar***,Kokkos::LayoutLeft,Kokkos::DefaultExecutionSpace> A, Kokkos::View<Scalar***,Kokkos::LayoutLeft,Kokkos::DefaultExecutionSpace> B,
Scalar beta, Kokkos::View<Scalar***,Kokkos::LayoutLeft,Kokkos::DefaultExecutionSpace> C){
const int m = static_cast<int> (C.dimension_1()),
n = static_cast<int> (C.dimension_2 ()),
k = (transA == Teuchos::NO_TRANS ? A.dimension_2 () : A.dimension_1 ());
// printf("m:%d,n:%d,k:%d",m,n,k);
Kokkos::parallel_for(C.dimension(0),blasOpenMPBatchLeft<Scalar>(A,B,C,m,n,k,transA,transB,alpha,beta));
}