mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Merged eigen/eigen into default
This commit is contained in:
@@ -57,6 +57,7 @@ static void test_simple_shuffling_sycl(const Eigen::SyclDevice& sycl_device)
|
||||
|
||||
gpu2.device(sycl_device)=gpu1.shuffle(shuffles);
|
||||
sycl_device.memcpyDeviceToHost(no_shuffle.data(), gpu_data2, buffSize);
|
||||
sycl_device.synchronize();
|
||||
|
||||
VERIFY_IS_EQUAL(no_shuffle.dimension(0), sizeDim1);
|
||||
VERIFY_IS_EQUAL(no_shuffle.dimension(1), sizeDim2);
|
||||
@@ -82,8 +83,9 @@ static void test_simple_shuffling_sycl(const Eigen::SyclDevice& sycl_device)
|
||||
DataType* gpu_data3 = static_cast<DataType*>(sycl_device.allocate(buffSize));
|
||||
TensorMap<Tensor<DataType, 4,DataLayout,IndexTypes>> gpu3(gpu_data3, tensorrangeShuffle);
|
||||
|
||||
gpu3.device(sycl_device)=gpu1.shuffle(shuffles);
|
||||
sycl_device.memcpyDeviceToHost(shuffle.data(), gpu_data3, buffSize);
|
||||
gpu3.device(sycl_device)=gpu1.shuffle(shuffles);
|
||||
sycl_device.memcpyDeviceToHost(shuffle.data(), gpu_data3, buffSize);
|
||||
sycl_device.synchronize();
|
||||
|
||||
VERIFY_IS_EQUAL(shuffle.dimension(0), sizeDim3);
|
||||
VERIFY_IS_EQUAL(shuffle.dimension(1), sizeDim4);
|
||||
|
||||
@@ -129,6 +129,19 @@ template<typename SparseMatrixType> void sparse_extra(const SparseMatrixType& re
|
||||
|
||||
}
|
||||
|
||||
template<typename SparseMatrixType>
|
||||
void check_marketio()
|
||||
{
|
||||
typedef Matrix<typename SparseMatrixType::Scalar, Dynamic, Dynamic> DenseMatrix;
|
||||
Index rows = internal::random<Index>(1,100);
|
||||
Index cols = internal::random<Index>(1,100);
|
||||
SparseMatrixType m1, m2;
|
||||
m1 = DenseMatrix::Random(rows, cols).sparseView();
|
||||
saveMarket(m1, "sparse_extra.mtx");
|
||||
loadMarket(m2, "sparse_extra.mtx");
|
||||
VERIFY_IS_EQUAL(DenseMatrix(m1),DenseMatrix(m2));
|
||||
}
|
||||
|
||||
void test_sparse_extra()
|
||||
{
|
||||
for(int i = 0; i < g_repeat; i++) {
|
||||
@@ -143,5 +156,15 @@ void test_sparse_extra()
|
||||
|
||||
CALL_SUBTEST_3( (sparse_product<DynamicSparseMatrix<float, ColMajor> >()) );
|
||||
CALL_SUBTEST_3( (sparse_product<DynamicSparseMatrix<float, RowMajor> >()) );
|
||||
|
||||
CALL_SUBTEST_4( (check_marketio<SparseMatrix<float,ColMajor,int> >()) );
|
||||
CALL_SUBTEST_4( (check_marketio<SparseMatrix<double,ColMajor,int> >()) );
|
||||
CALL_SUBTEST_4( (check_marketio<SparseMatrix<std::complex<float>,ColMajor,int> >()) );
|
||||
CALL_SUBTEST_4( (check_marketio<SparseMatrix<std::complex<double>,ColMajor,int> >()) );
|
||||
CALL_SUBTEST_4( (check_marketio<SparseMatrix<float,ColMajor,long int> >()) );
|
||||
CALL_SUBTEST_4( (check_marketio<SparseMatrix<double,ColMajor,long int> >()) );
|
||||
CALL_SUBTEST_4( (check_marketio<SparseMatrix<std::complex<float>,ColMajor,long int> >()) );
|
||||
CALL_SUBTEST_4( (check_marketio<SparseMatrix<std::complex<double>,ColMajor,long int> >()) );
|
||||
TEST_SET_BUT_UNUSED_VARIABLE(s);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user