Quize -SpMV

1. Consider the following sparse matrix:

1070

0080

0430

2001

Which is the correct row_ptr array forstoring in CSR format?

2.Consider the following sparse matrix:

3040

0000

0542

2001

ln ELL format, where 's the element "5" in theData array?(Index starts from 0)
 

3: The following is the code for the parallel SpMV/CSRkernel, with CSR storage formats including data and row_ ptr, col_index.The correct code on the index line should be:

                __global__ void SpMV_CSR(int num_rows,float *data,int*col_index,int *row_ptr, float *x, float *y){

int row = blockldx.x * blockDim.x + threadldx.x;

if(row < num_rows){

float dot = o;

int row_start = row_ptr[row];int row_end = row_ptr[row+1];

for (int elem = row_start; elem < row_end; elem++){

dot +=__________________;

}

y[row] += dot;}

}

4.Which of the following statements is NOTCORRECT?

A:JDS format sorts columns based on their length

B:In ELL format, we no longer need row_ptr array

C:The elements in Coo format can bereordered arbitrarily without losing any information 

D:The elements in each row of CSR can bestored out of order

以下陈述中哪个是不正确的?

A: JDS 格式根据列长度进行排序。

B: 在 ELL 格式中,我们不再需要 row_ptr 数组。

C: Coo 格式中的元素可以重新排序而不会丢失任何信息。

D: CSR 每行中的元素可以无序存储。

5. 以下哪一项是COO格式的缺点?
A: 不利于稀疏矩阵格式之间的快速转换
B: 无法直接执行算术运算
C:COO格式中的元素不能任意重新排序
D: 无法快速转换为CSR/CSC格式

6. 红色标记的“ NUM_ELEM ”的含义是:
为了您的方便,下面给出了来自SPMV_ELL内核的相关代码片段:

原始稀疏矩阵中所有行的数目。
原始稀疏矩阵的所有行中非零元素的最大数目。
原始稀疏矩阵的所有行中非零元素的最小数目。
原始稀疏矩阵所有行中零元素的最大数目。

1. For the work inefficient scan kernel based on reduction trees,assume that we have1024elements,which of the followinggives the closest approximation of thenumber of add operations performed?

对于基于归约树的工作效率低下的扫描内核,假设我们有1024个元素,下面哪个选项最接近执行的加法操作次数?

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值