99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

ECE1747H代做、代寫python,Java程序

時(shí)間:2023-11-27  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



 Assignment 2: Parallelize What Seems Inherently Sequential: ECE17**H F LEC0101 20239:Parallel Programming

Assignment 2: Parallelize What Seems
Inherently Sequential
Introduction

In parallel computing, there are operations that, at first glance, seem inherently sequential but can
be transformed and executed efficiently in parallel. One such operation is the "scan". At its
essence, the scan operation processes an array to produce a new array where each element is
the result of a binary associative operation applied to all preceding elements in the original array.
Consider an array of numbers, and envision producing a new array where each element is the
sum of all previous numbers in the original array. This type of scan that uses "+" as the binary
operator is commonly known as a "prefix-sum".  Scan has two primary variants: exclusive and
inclusive. In an exclusive scan, the result at each position excludes the current element, while in
an inclusive scan, it includes the current element. For instance, given an array [3, 1, 7, 0] and
an addition operation, an exclusive scan would produce [0, 3, 4, 11] , and an inclusive scan
would produce [3, 4, 11, 11] . 
Scan operations are foundational in parallel algorithms, with applications spanning from sorting to
stream compaction, building histograms and even more advanced tasks like constructing data
structures in parallel. In this assignment, we'll delve deep into the intricacies of scan, exploring its
efficient implementation using CUDA.

Assignment Description

In this assignment, you will implement a parallel scan using CUDA. Let's further assume that the
scan is inclusive and the operator involved in the scan is addition. In other words, you will be
implementing an inclusive prefix sum.
The following is a sequential version of inclusive prefix sum:

void sequential_scan(int *x, int *y, unsigned int N) {
  y[0] = x[0];
  for(unsigned int i = 1; i < N; ++i) {
    y[i] = y[i - 1] + x[i];
  }
}

While this might seem like a task demanding sequential processing, with the right algorithm, it can
be efficiently parallelized. Your parallel implementation will be compared against the sequential
 Assignment 2: Parallelize What Seems Inherently Sequential: ECE17**H F LEC0101 20239:Parallel Programming
 2/8

version which runs on the CPU. The mark will be based on the speedup achieved by your
implementation. Note that data transfer time is not included in this assignment. However, in real
world applications, data transfer in often a bottleneck and is important to include that in the
speedup calculation.

Potential Algorithms

 In this section, I describe a few algorithms to implement a parallel scan on GPU, which you may
use for this assignment. Of course, you may also choose to use other algorithms. These
algorithms are chosen for their simplicity and may not be the fastest.
We will first present algorithms for performing parallel segmented scan, in which every thread
block will perform a scan on a segment of elements in the input array in parallel. We will then
present methods that combine the segmented scan results into the scan output for the entire input
array.

Segmented Scan Algorithms

The exploration of parallel solutions for scan problems has a long history, spanning several
decades. Interestingly, this research began even before the formal establishment of Computer
Science as a discipline. Scan circuits, crucial to the operation of high-speed adder hardware like
carry-skip adders, carry-select adders, and carry-lookahead adders, stand as evidence of this
pioneering research.
As we know, the fastest parallel method to compute the sum of a set of values is through a
reduction tree. Given enough execution units, this tree can compute the sum of N values in
log2(N) time units. Additionally, the tree can produce intermediate sums, which can be used to
produce the scan (prefix sum) output values. This principle is the foundation of the design of both
the Kogge-Stone and Brent-Kung adders.

Brent-Kung Algorithm
 Assignment 2: Parallelize What Seems Inherently Sequential: ECE17**H F LEC0101 20239:Parallel Programming
 3/8

The above figure show the steps for a parallel inclusive prefix sum algorithm based on the BrentKung
 adder design. The top half of the figure produces the sum of all 16 values in 4 steps. This is
exactly how a reduction tree works. The second part of the algorithm (bottom half of the figure) is
to use a reverse tree to distribute the partial sums and use them to complete the result of those
positions. 

Kogge-Stone Algorithm

The Kogge-Stone algorithm is a well-known, minimum-depth network that uses a recursivedoubling
 approach for aggregating partial reductions. The above figure shows an in-place scan
 Assignment 2: Parallelize What Seems Inherently Sequential: ECE17**H F LEC0101 20239:Parallel Programming
 4/8

algorithm that operates on an array X that originally contains input values. It iteratively evolves the
contents of the array into output elements. 
In the first iteration, each position other than X[0] receives the sum of its current content and that
of its left neighbor. This is illustrated by the first row of addition operators in the figure. As a result,
X[i] contains xi-1 +xi. In the second iteration, each position other than X[0] and X[1] receives the
sum of its current content and that of the position that is two elements away (see the second row
of adders). After k iterations, X[i] will contain the sum of up to 2^k input elements at and before the
location. 
Although it has a work complexity of O(nlogn), its shallow depth and simple shared memory
address calculations make it a favorable approach for SIMD (SIMT) setups, like GPU warps.

Scan for Arbitrary-length Inputs

For many applications, the number of elements to be processed by a scan operation can be in the
millions or even billions. The algorithms that we have presented so far perform local scans on
input segments. Therefore, we still need a way to consolidate the results from different sections.

Hierarchical Scan

One of such consolidation approaches is hierarchical scan. For a large dataset we first partition
the input into sections so that each of them can fit into the shared memory of a streaming
multiprocessor (GPU) and be processed by a single block. The aforementioned algorithms can be
used to perform scan on each partition. At the end of the grid execution, the Y array will contain
the scan results for individual sections, called scan blocks (see the above figure). The second
step gathers the last result elements from each scan block into an array S and performs a scan on
these output elements. In the last step of the hierarchical scan algorithm, the intermediate result in
S will be added to the corresponding elements in Y to form the final result of the scan.
For those who are familiar with computer arithmetic circuits, you may already recognize that the
principle behind the hierarchical scan algorithm is quite similar to that of carry look-ahead adders
 Assignment 2: Parallelize What Seems Inherently Sequential: ECE17**H F LEC0101 20239:Parallel Programming
 5/8

in modern processor hardwares.

Single Pass Scan

One issue with hierarchical scan is that the partially scanned results are stored into global
memory after step 1 and reloaded from global memory before step 3. The memory access is not
overlapped with computation and can significantly affect the performance of the scan
implementation (as shown in the above figure).
There exists many techniques proposed to mitigate this issue. Single-pass chained scan (also
called stream-based scan or domino-style scan) passes the partial sum data in one directory
across adjacent blocks. Chained-scan is based on a key observation that the global scan step
(step 2 in hierarchical scan) can be performed in a domino fashion (i.e. from left to right, and the
output can be immediately used). As a result, the global scan step does not require a global
synchronization after it, since each segment only needs the partial sum of segments before itself.

Further Reading

Parallel Prefix Sum (Scan) with CUDA


Single-pass
 Parallel Prefix Scan with Decoupled Look-back


Report
 Assignment 2: Parallelize What Seems Inherently Sequential: ECE17**H F LEC0101 20239:Parallel Programming


Along with your code, you will also need to submit a report. Your report should describe the
following aspects in detail:
Describe what algorithm did you choose and why.
Describe any design decisions you made and why. Explain how they might affect performance.
Describe anything you tried (even they are not in the final implementation) and if they worked
or not. Why or why not.
Analyze the bottleneck of your current implementation and what are the potential
optimizations.
Use font Times New Roman, size 10, single spaced. The length of the report should not exceed 3
pages.

Setup

Initial Setup

Start by unzipping the provided starter code a2.zip

 into a protected directory within your
UG home directory. There are a multiple files in the provided zip file, the only file you will need
to modify and hand in is implementation.cu. You are not allowed to modify other files as only
your implementation.cu file will be tested for marking.
Within implementations.cu, you need to insert your identification information in the
print_team_info() function. This information is used for marking, so do it right away before you
start the assignment.

Compilation

The assignment uses GNU Make to compile the source code. Run make in the assignment
directory to compile the project, and the executable named ece17**a2 should appear in the same
directory.

Coding Rules

The coding rule is very simple.
You must not use any existing GPU parallel programming library such as thrust and cub. 
You may implement any algorithm you want.
Your implementation must use CUDA C++ and compilable using the provided Makefile. 
You must not interfere or attempt to alter the time measurement mechanism.
Your implementation must be properly synchronized so that all operations must be finished
before your implementation returns.

Evaluation
 Assignment 2: Parallelize What Seems Inherently Sequential: ECE17**H F LEC0101 20239:Parallel Programming
 7/8

The assignment will be evaluated on an UG machine equipped with Nvidia GPU. Therefore, make
sure to test your implementation on the UG machines before submission. When you evaluate your
implementation using the command below, you should receive similar output.

ece17**a2 -g
************************************************************************************
Submission Information:
nick_name: default-name
student_first_name: john
student_last_name: doe
student_student_number: 0000000000
************************************************************************************
Performance Results:
Time consumed by the sequential implementation: 124374us
Time consumed by your implementation: 1250**us
Optimization Speedup Ratio (nearest integer): 1
************************************************************************************

Marking Scheme

The total available marks for the assignment are divided as follows: 20% for the lab report, 65%
for the non-competitive portion, and 15% for the competitive portion. The non-competitive section
is designed to allow individuals who put in minimal effort to pass the course, while the competitive
section aims to reward those who demonstrate higher merit.

Non-competitive Portion (65%)

Achieving full marks in the non-competitive portion should be straightforward for anyone who puts
in the minimal acceptable amount of effort. You will be awarded full marks in this section if your
implementation achieves a threshold speedup of 30x. Based on submissions during the
assignment, the TA reserves the right to adjust this threshold as deemed appropriate, providing at
least one week's notice.

Competitive Portion (15%)

Marks in this section will be determined based on the speedup of your implementation relative to
the best and worst speedups in the class. The formula for this is:

mark = (your speedup - worst speedup over threshold) / (top speedup - worst speedup over threshold)

Throughout the assignment, updates on competitive marks will be posted on Piazza at intervals
not exceeding 24 hours.
 The speedup will be measure on a standard UG machine equipped with GPU. (Therefore, make
sure to test your implementations on the UG machines). The final marking will be performed after
the submission deadline on all valid submissions.

Submission

Submit your report on Quercus. Make sure your report is in pdf format and can be viewed with
standard pdf viewer  (e.g. xpdf or acroread).
 Assignment 2: Parallelize What Seems Inherently Sequential: ECE17**H F LEC0101 20239:Parallel Programming
 8/8

When you have completed the lab, you will hand in just implementation.cu that contains your
solution. The standard procedure to submit your assignment is by typing submitece17**f 2
implementation.cu on one of the UG machines.
Make sure you have included your identifying information in the print team info() function.
Remove any extraneous print statements.

請(qǐng)加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:二維碼制作:有效的營(yíng)銷工具
  • 下一篇:代寫CSC3100 Data Structures
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    出評(píng) 開(kāi)團(tuán)工具
    出評(píng) 開(kāi)團(tuán)工具
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士2號(hào)線
    合肥機(jī)場(chǎng)巴士2號(hào)線
    合肥機(jī)場(chǎng)巴士1號(hào)線
    合肥機(jī)場(chǎng)巴士1號(hào)線
  • 短信驗(yàn)證碼 豆包 幣安下載 AI生圖 目錄網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                欧美日韩一区国产| 日韩欧美123| 欧美三级乱人伦电影| 亚洲综合一区在线| 欧美性受xxxx黑人xyx| 日韩黄色片在线观看| 精品久久人人做人人爰| 国产精品99久久久久久有的能看| 国产精品久久久久影院亚瑟| 欧美综合视频在线观看| 久久福利资源站| 亚洲蜜臀av乱码久久精品| 91精品国产综合久久蜜臀| 国产成人免费视频网站| 亚洲曰韩产成在线| 精品国精品国产| 在线观看三级视频欧美| 国内精品国产成人| 亚洲一二三四久久| 国产欧美日本一区视频| 欧美日韩亚洲高清一区二区| 国产永久精品大片wwwapp| 国产精品天美传媒| 精品国产乱码久久久久久牛牛| 成人动漫一区二区| 日韩成人一级大片| 国产日产欧美一区二区视频| 成人精品亚洲人成在线| |精品福利一区二区三区| 日韩精品一区二区三区中文不卡| 国产伦理精品不卡| 中文字幕在线不卡一区| 欧美日韩国产影片| 国产原创一区二区三区| 亚洲免费在线电影| 精品国产sm最大网站免费看| 99精品久久免费看蜜臀剧情介绍| 午夜激情久久久| 国产亚洲福利社区一区| 亚洲欧美影音先锋| 国产在线一区观看| 亚洲国产高清不卡| 欧美人伦禁忌dvd放荡欲情| 国产mv日韩mv欧美| 亚洲成在人线在线播放| 国产午夜亚洲精品理论片色戒 | 亚洲国产岛国毛片在线| 91色porny| 国产精品中文字幕一区二区三区| 亚洲品质自拍视频网站| 337p日本欧洲亚洲大胆色噜噜| 欧美日韩一区二区在线视频| 国产成人免费视频精品含羞草妖精| 亚洲免费视频中文字幕| 国产日韩欧美亚洲| 精品国产乱码久久久久久影片| 91久久一区二区| 国产高清成人在线| 久久精品国产成人一区二区三区| 欧美精品一区二区三区很污很色的| 国产精品911| 亚洲欧洲制服丝袜| 亚洲成年人网站在线观看| 最新欧美精品一区二区三区| 欧美国产97人人爽人人喊| 精品免费日韩av| 日韩一区二区三区视频在线| 欧美色区777第一页| 91女厕偷拍女厕偷拍高清| 成人深夜在线观看| 亚洲精品免费在线观看| 天天亚洲美女在线视频| 视频一区二区三区中文字幕| 性做久久久久久免费观看欧美| 亚洲精品视频在线观看免费| 亚洲另类春色国产| 综合亚洲深深色噜噜狠狠网站| 日本一二三不卡| 国产精品理论在线观看| 国产精品久久久久久久蜜臀 | 91精品国产综合久久香蕉的特点 | 免费人成在线不卡| 亚洲18色成人| 青青草97国产精品免费观看| 日本不卡不码高清免费观看| 免费成人美女在线观看| 久久99热这里只有精品| 国产精品系列在线观看| 成人免费看视频| 色爱区综合激月婷婷| 在线看日韩精品电影| 欧美视频一区在线| 日韩久久精品一区| 中日韩av电影| 亚洲一区二区三区爽爽爽爽爽| 亚洲一区二区三区激情| 日本午夜一本久久久综合| 亚洲欧美二区三区| 一区在线观看视频| 亚洲一区二区三区美女| 蜜臀av在线播放一区二区三区| 久久99精品一区二区三区| 成人小视频免费在线观看| 欧美自拍偷拍午夜视频| 日韩午夜电影在线观看| 国产精品高清亚洲| 日韩电影一区二区三区| 成人一区二区三区| 欧美精品18+| 国产欧美一区二区精品仙草咪| 亚洲欧洲国产日韩| 日本午夜精品一区二区三区电影| 国产成人自拍高清视频在线免费播放| 久久99精品久久久久婷婷| 国产欧美在线观看一区| 国产很黄免费观看久久| 国产精品中文字幕日韩精品| 欧美日韩视频一区二区| 国产网站一区二区| 日韩国产欧美在线观看| av亚洲精华国产精华精华| 国产成人免费av在线| 欧美成人aa大片| 久久婷婷国产综合国色天香| 亚洲蜜桃精久久久久久久| 美女一区二区三区在线观看| 91在线视频免费观看| 久久久国产一区二区三区四区小说| 国产日韩精品一区| 综合婷婷亚洲小说| 国产精品美女视频| 日韩成人一区二区三区在线观看| 成人蜜臀av电影| 日韩精品中文字幕一区| 依依成人综合视频| 国产精品中文字幕日韩精品| 欧美大白屁股肥臀xxxxxx| 亚洲一区二区精品视频| 欧美日韩视频在线一区二区| 国产成人免费在线| www.色综合.com| 国产欧美一区二区三区鸳鸯浴| 麻豆精品在线视频| 欧美性生活久久| 2020国产成人综合网| 天天综合网天天综合色| 色视频成人在线观看免| 综合自拍亚洲综合图不卡区| 成人天堂资源www在线| 久久嫩草精品久久久精品| 久久66热re国产| 精品国产一区二区三区久久影院| 视频一区二区三区在线| 欧美人伦禁忌dvd放荡欲情| 亚洲丰满少妇videoshd| 欧美网站大全在线观看| 亚洲国产毛片aaaaa无费看| 一区二区在线观看免费| 在线亚洲欧美专区二区| av电影在线观看完整版一区二区| 亚洲国产日产av| 欧美一级欧美三级在线观看| 国产在线一区二区| 久久精品夜色噜噜亚洲a∨| 香蕉成人伊视频在线观看| 这里只有精品99re| 国产一区二区三区免费看| 国产午夜精品一区二区三区嫩草 | 偷拍亚洲欧洲综合| 日韩一区二区免费高清| 国产一区二区在线免费观看| 国产日韩欧美a| 欧美中文字幕一区| 激情欧美一区二区三区在线观看| 国产日韩欧美综合在线| 色婷婷综合久久久中文字幕| 中文字幕在线不卡一区| 884aa四虎影成人精品一区| 国产乱码字幕精品高清av| 国产亚洲精品aa午夜观看| 国产成人亚洲综合a∨婷婷| 日韩欧美一级二级| 91女厕偷拍女厕偷拍高清| 日韩av成人高清| 亚洲特黄一级片| 精品电影一区二区| 91丨九色porny丨蝌蚪| 男人操女人的视频在线观看欧美| 国产精品视频免费看| 成人动漫在线一区| 久久精品国产色蜜蜜麻豆| 中文字幕一区二区三区在线不卡 | 在线观看国产一区二区| 麻豆91小视频| 亚洲一区二区三区视频在线播放| 一本大道久久a久久综合婷婷| 蜜桃视频一区二区三区| 综合av第一页| 久久综合九色综合97婷婷女人 | 午夜国产精品一区|