91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

COM6521代做、代寫c/c++編程設計

時間:2024-04-26  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



COM4521/COM6521 Parallel Computing with
Graphical Processing Units (GPUs)
Assignment (80% of module mark)
Deadline: 5pm Friday 17th May (Week 12)
Starting Code: Download Here
Document Changes
Any corrections or changes to this document will be noted here and an update
will be sent out via the course’s Google group mailing list.
Document Built On: 17 January 2024
Introduction
This assessment has been designed against the module’s learning objectives. The
assignment is worth 80% of the total module mark. The aim of the assignment is
to assess your ability and understanding of implementing and optimising parallel
algorithms using both OpenMP and CUDA.
An existing project containing a single threaded implementation of three algorithms has been provided. This provided starting code also contains functions
for validating the correctness, and timing the performance of your implemented
algorithms.
You are expected to implement both an OpenMP and a CUDA version of each of
the provided algorithms, and to complete a report to document and justify the
techniques you have used, and demonstrate how profiling and/or benchmarking
supports your justification.
The Algorithms & Starting Code
Three algorithms have been selected which cover a variety of parallel patterns for
you to implement. As these are independent algorithms, they can be approached
in any order and their difficulty does vary. You may redesign the algorithms in
1
your own implementations for improved performance, providing input/output
pairs remain unchanged.
The reference implementation and starting code are available to download from:
https://codeload.github.com/RSE-Sheffield/COMCUDA_assignment_c614d9
bf/zip/refs/heads/master
Each of the algorithms are described in more detail below.
Standard Deviation (Population)
Thrust/CUB may not be used for this stage of the assignment.
You are provided two parameters:
• An array of floating point values input.
• The length of the input array N.
You must calculate the standard deviation (population) of input and return a
floating point result.
The components of equation 1 are:
• σ: The population standard deviation

P = The sum of..
• xi = ..each value
• µ = The mean of the population
• N: The size of the population
σ =
sPN
i=1(xi − µ)
2
N
(1)
The algorithm within cpu.c::cpu_standarddeviation() has several steps:
1. Calculate the mean of input.
2. Subtract mean from each element of input.
3. Square each of the resulting elements from the previous step.
4. Calculate the sum of the resulting array from the previous step.
5. Divide sum by n.
6. Return the square root of the previous step’s result.
It can be executed either via specifying a random seed and population size, e.g.:
<executable> CPU SD 12 100000
Or via specifying the path to a .csv input file, e.g.:
<executable> CPU SD sd_in.csv
2
Convolution
You are provided four parameters:
• A 1 dimensional input array input image.
• A 1 dimensional output array output image.
• The width of the image input.
• The height of the image input.
Figure 1: An example of a source image (left) and it’s gradient magnitude (right).
You must calculate the gradient magnitude of the greyscale image input. The
horizontal (Gx) and vertical (Gy) Sobel operators (equation 2) are applied to
each non-boundary pixel (P) and the magnitude calculated (equation 3) to
produce a gradient magnitude image to be stored in output. Figure 1 provides
an example of a source image and it’s resulting gradient magnitude.

(3)
A convolution is performed by aligning the centre of the Sobel operator with a
pixel, and summing the result of multiplying each weight with it’s corresponding
pixel. The resulting value must then be clamped, to ensure it does not go out of
bounds.

The convolution operation is demonstrated in equation 4. A pixel with value
5 and it’s Moore neighbourhood are shown. This matrix is then componentwise multiplied (Hadamard product) by the horizontal Sobel operator and the
components of the resulting matrix are summed.
Pixels at the edge of the image do not have a full Moore neighbourhood, and
therefore cannot be processed. As such, the output image will be 2 pixels smaller
in each dimension.
The algorithm implemented within cpu.c::cpu_convolution() has four steps
performed per non-boundary pixel of the input image:
1. Calculate horizontal Sobel convolution of the pixel.
2. Calculate vertical Sobel convolution of the pixel.
3. Calculate the gradient magnitude from the two convolution results
4. Approximately normalise the gradient magnitude and store it in the output
image.
It can be executed via specifying the path to an input .png image, optionally a
second output .png image can be specified, e.g.:
<executable> CPU C c_in.png c_out.png
Data Structure
You are provided four parameters:
• A sorted array of integer keys keys.
• The length of the input array len_k.
• A preallocated array for output boundaries.
• The length of the output array len_b.
You must calculate the index of the first occurrence of each integer within the
inclusive-exclusive range [0, len_b), and store it at the corresponding index in
the output array. Where an integer does not occur within the input array, it
should be assigned the index of the next integer which does occur in the array.
This algorithm constructs an index to data stored within the input array, this is
commonly used in data structures such as graphs and spatial binning. Typically
there would be one or more value arrays that have been pair sorted with the key
array (keys). The below code shows how values attached to the integer key 10
could be accessed.
for (unsigned int i = boundaries[10]; i < boundaries[11]; ++i) {
float v = values[i];
// Do something
}
The algorithm implemented within cpu.c::cpu_datastructure() has two
steps:
4
1. An intermediate array of length len_b must be allocated, and a histogram
of the values from keys calculated within it.
2. An exclusive prefix sum (scan) operation is performed across the previous
step’s histogram, creating the output array boundaries.
Figure 2 provides a visual example of this algorithm.
0 1 1 3 4 4 4
0 1 3 3 **
1 2 0 1 3
+ + + + + + +
+ + + + + + + + + +
keys
histogram
boundaries
0 1 2 3 4 5 6
0 1 2 3 4
0 1 2 3 4 5
Figure 2: An example showing how the input keys produces boundaries in the
provided algorithm.
It can be executed via specifying either a random seed and array length, e.g.:
<executable> CPU DS 12 100000
Or, via specifying the path to an input .csv, e.g.:
<executable> CPU DS ds_in.csv
Optionally, a .csv may also be specified for the output to be stored, e.g.:
<executable> CPU DS 12 100000 ds_out.csv
<executable> CPU DS ds_in.csv ds_out.csv
The Task
Code
For this assignment you must complete the code found in both openmp.c
and cuda.cu, so that they perform the same algorithm described above
and found in the reference implementation (cpu.c), using OpenMP and
CUDA respectively. You should not modify or create any other files within
the project. The two algorithms to be implemented are separated into 3
methods named openmp_standarddeviation(), openmp_convolution() and
openmp_datastructure() respectively (and likewise for CUDA).
You should implement the OpenMP and CUDA algorithms with the intention of
achieving the fastest performance for each algorithm on the hardware that you
5
use to develop and test your assignment.
It is important to free all used memory as memory leaks could cause the
benchmark mode, which repeats the algorithm, to run out of memory.
Report
You are expected to provide a report alongside your code submission. For each of
the 6 algorithms that you implement you should complete the template provided
in Appendix A. The report is your chance to demonstrate to the marker that
you understand what has been taught in the module.
Benchmarks should always be carried out in Release mode, with timing
averaged over several runs. The provided project code has a runtime argument
--bench which will repeat the algorithm for a given input 100 times (defined
in config.h). It is important to benchmark over a range of inputs, to allow
consideration of how the performance of each stage scales.
Deliverables
You must submit your openmp.c, cuda.cu and your report document
(e.g. .pdf/.docx) within a single zip file via Mole, before the deadline. Your
code should build in the Release mode configuration without errors or warnings
(other than those caused by IntelliSense) on Diamond machines. You do not
need to hand in any other project or code files other than openmp.c, cuda.cu.
As such, it is important that you do not modify any of the other files provided
in the starting code so that your submitted code remains compatible with the
projects that will be used to mark your submission.
Your code should not rely on any third party tools/libraries except for those
introduced within the lectures/lab classes. Hence, the use of Thrust and CUB is
permitted except for the standard deviation algorithm.
Even if you do not complete all aspects of the assignment, partial progress should
be submitted as this can still receive marks.
Marking
When marking, both the correctness of the output, and the quality/appropriateness of the technique used will be assessed. The report
should be used to demonstrate your understanding of the module’s theoretical
content by justifying the approaches taken and showing their impact on the
performance. The marks for each stage of the assignment will be distributed as
follows:
6
OpenMP (30%) CUDA (70%)
Stage 1 (**%) 9.6% 22.4%
Stage 2 (34%) 10.2% 23.8%
Stage 3 (34%) 10.2% 23.8%
The CUDA stage is more heavily weighted as it is more difficult.
For each of the 6 stages in total, the distribution of the marks will be determined
by the following criteria:
1. Quality of implementation
• Have all parts of the stage been implemented?
• Is the implementation free from race conditions or other errors regardless
of the output?
• Is code structured clearly and logically?
• How optimal is the solution that has been implemented? Has good hardware
utilisation been achieved?
2. Automated tests to check for correctness in a range of conditions
• Is the implementation for the specific stage complete and correct (i.e. when
compared to a number of test cases which will vary the input)?
3. Choice, justification and performance reporting of the approach towards
implementation as evidenced in the report.
• A breakdown of how marks are awarded is provided in the report structure
template in Appendix A.
These 3 criteria have roughly equal weighting (each worth 25-40%).
If you submit work after the deadline you will incur a deduction of 5% of the
mark for each working day that the work is late after the deadline. Work
submitted more than 5 working days late will be graded as 0. This is the same
lateness policy applied university wide to all undergraduate and postgraduate
programmes.
Assignment Help & Feedback
The lab classes should be used for feedback from demonstrators and the module
leaders. You should aim to work iteratively by seeking feedback throughout the
semester. If leave your assignment work until the final week you will limit your
opportunity for feedback.
For questions you should either bring these to the lab classes or use the course’s
Google group (COM452**group@sheffield.ac.uk) which is monitored by the
course’s teaching staff. However, as messages to the Google group are public to
7
all students, emails should avoid including assignment code, instead they should
be questions about ideas, techniques and specific error messages rather than
requests to fix code.
If you are uncomfortable asking questions, you may prefer to use the course’s
anonymous google form. Anonymous questions must be well formed, as there is
no possibility for clarification, otherwise they risk being ignored.
Please do not email teaching assistants or the module leader directly for assignment help. Any direct requests for help will be redirected to the above
mechanisms for obtaining help and support.
8
Appendix A: Report Structure Template
Each stage should focus on a specific choice of technique which you have applied
in your implementation. E.g. OpenMP Scheduling, OpenMP approaches for
avoiding race conditions, CUDA memory caching, Atomics, Reductions, Warp
operations, Shared Memory, etc. Each stage should be no more than 500 words
and may be far fewer for some stages.
<OpenMP/CUDA>: Algorithm <Standard Deviation/Convolution/Data Structure>
Description
• Briefly describe how the stage is implemented focusing on what choice of
technique you have applied to your code.
Marks will be awarded for:
• Clarity of description
Justification
• Describe why you selected a particular technique or approach. Provide
justification to demonstrate your understanding of content from the
lectures and labs as to why the approach is appropriate and efficient.
Marks will be awarded for:
• Appropriateness of the approach. I.e. Is this the most efficient choice?
• Justification of the approach and demonstration of understanding
Performance
Size CPU Reference Timing (ms) <Mode> Timing (ms)
• Decide appropriate benchmark configurations to best demonstrate scaling
of your optimised algorithm.
• Report your benchmark results, for example in the table provided above
• Describe which aspects of your implementation limits performance? E.g.
Is your code compute, memory or latency bound on the GPU? Have you
performed any profiling? Is a particular operation slow?
• What could be improved in your code if you had more time?
Marks will be awarded for:
9
• Appropriateness of the used benchmark configurations.
• Does the justification match the experimental result?
• Have limiting factors of the code been identified?
• Has justification for limiting factors been described or evidenced

?請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp

掃一掃在手機打開當前頁
  • 上一篇:菲律賓工作只能使用9G工作簽證嗎 如何辦理9G工簽
  • 下一篇:COMP222代寫、Python, Java程序語言代做
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区
    精品噜噜噜噜久久久久久久久试看 | 99久久99精品久久久久久| 成人免费一区二区三区视频| 欧美午夜精品久久久久久超碰| 国产精品资源在线| 日韩一区二区三区三四区视频在线观看 | 国产精品99久久久久久似苏梦涵 | 亚洲欧美日韩小说| 久久精工是国产品牌吗| 欧美老肥妇做.爰bbww视频| 秋霞国产午夜精品免费视频| 欧美一区二区三区在线观看视频| 91丨porny丨中文| 久久综合狠狠综合久久综合88 | 日韩免费电影网站| 一本色道久久综合亚洲精品婷婷| 欧美国产国产综合| 久久精品30| 欧美另类专区| 亚洲色图一区二区| 日韩一区精品视频| 欧美精品免费视频| 综合网在线视频| 欧美一级一级性生活免费录像| 国内自拍视频一区二区三区| 久久久噜噜噜久噜久久综合| 欧美一卡二卡在线| 久久综合九色综合欧美98 | 亚洲精品视频免费观看| 福利一区二区在线| 黄色亚洲在线| 欧美日韩电影一区| 国产午夜精品久久久久久久| 一区二区免费看| 成人免费视频视频在线观看免费| 欧美日本二区| 欧美日韩你懂得| 亚洲欧洲日韩女同| 亚洲国产精品自拍| 亚洲久本草在线中文字幕| 九色porny丨国产精品| 国产日韩一区二区三区在线| 久久蜜桃一区二区| 天天综合色天天| 亚洲成色www久久网站| 午夜在线播放视频欧美| 欧美成人国产一区二区| 亚洲成a人在线观看| 伊人久久久大香线蕉综合直播| 国产伦精品一区二区三区照片91 | 免费成人性网站| 国产精品日本一区二区| 国产很黄免费观看久久| 亚洲欧美激情在线| 精品一区二区免费视频| 亚洲综合另类| 亚洲一二三四在线| 国产嫩草一区二区三区在线观看| 欧美激情中文字幕| 亚洲黄色成人| 亚洲成人动漫在线免费观看| 一区一区视频| 亚洲激情图片小说视频| 99国产精品久久久久老师| 国产精品国产三级国产普通话三级 | 国产精品嫩草99a| 亚洲欧洲久久| 亚洲成av人片一区二区梦乃 | 国产精品美女久久久久高潮| 92精品国产成人观看免费| 精品日韩一区二区三区| 亚洲欧美亚洲| 亚洲成人在线网站| 欧洲亚洲国产日韩| 亚洲视频免费在线| 久久久久久久久久电影| 久久国产一二区| 国产精品亲子乱子伦xxxx裸| 国产精品久久国产三级国电话系列 | 亚洲精品视频在线看| 欧美在线色视频| 国内精品写真在线观看| 久热re这里精品视频在线6| 亚洲网站啪啪| 国产精品国产三级国产专区53| 成熟亚洲日本毛茸茸凸凹| 狠狠色丁香婷综合久久| 久久久国产精华| 色八戒一区二区三区| 在线观看日韩av电影| 极品日韩av| 伊人激情综合| 99www免费人成精品| 国产精品日韩欧美一区二区三区 | 最近中文字幕一区二区三区| 亚洲精品欧美激情| 欧美日韩视频不卡| 国产欧美日本在线| 欧美黄色免费| 91麻豆国产福利精品| 国产欧美日韩亚洲一区二区三区| 国产一区中文字幕| 久久精品国产99久久6| 亚洲欧美日韩国产另类专区| 久久综合资源网| 精品国精品自拍自在线| 欧美美女一区二区三区| 91精品1区2区| 亚洲免费精品| 狠狠入ady亚洲精品| 欧美视频二区| 亚洲国产国产亚洲一二三| 欧美日韩在线不卡一区| 激情婷婷久久| 亚洲国产一区在线| 亚洲精品看片| 一本一道久久a久久精品| 久久一区精品| 欧美一区二区三区小说| 日韩三级av在线播放| 一区二区三区在线免费视频| 欧美一区永久视频免费观看| 麻豆久久久久久久| 欧美本精品男人aⅴ天堂| 色一情一乱一乱一91av| 国产九色精品成人porny| 国产欧美1区2区3区| 日韩在线观看一区二区| 亚洲精品菠萝久久久久久久| 亚洲精品网站在线观看| 香蕉av福利精品导航| 日韩av网站免费在线| 国产麻豆一精品一av一免费| 高清shemale亚洲人妖| 欧美午夜精品理论片a级大开眼界| 亚洲性感激情| 在线区一区二视频| 日韩午夜在线观看| 亚洲男人的天堂一区二区| 日韩黄色片在线观看| www.一区二区| 国产日韩一区二区| 91精品欧美福利在线观看| 国产日韩欧美激情| 久久99精品国产.久久久久久| 成人午夜免费电影| 国产欧美二区| 欧美电影免费观看高清完整版| 亚洲视频在线一区二区| 国产尤物一区二区| 国产精品免费区二区三区观看| 日韩一区二区在线观看| 亚洲午夜日本在线观看| www.在线欧美| 黑人中文字幕一区二区三区| 欧美日韩国产首页| 午夜激情一区二区| 黄色精品网站| 国产欧美一区在线| 国产乱色国产精品免费视频| 麻豆九一精品爱看视频在线观看免费| 久久综合视频网| 国产麻豆视频一区二区| 色美美综合视频| 精品国产第一区二区三区观看体验| 亚洲在线成人精品| 亚洲一级二级| 国产精品久久99| 欧美日韩在线一区二区三区| 久久久影视传媒| 99视频在线精品| 日韩精品一区二区在线| 成人性生交大片免费看中文网站| 欧美一级在线观看| 国产成人免费在线| 日韩免费观看高清完整版| 激情六月婷婷久久| 69p69国产精品| 处破女av一区二区| 久久夜色精品国产欧美乱极品| 国产激情视频一区二区三区欧美 | 亚洲国产精品一区二区www在线| 欧美高清一区| 亚洲免费在线观看视频| 久久av一区二区三区| 日韩福利电影在线观看| 欧美二区三区91| 国内精品国语自产拍在线观看| 亚洲免费av观看| 欧美无人高清视频在线观看| 紧缚捆绑精品一区二区| 欧美成人伊人久久综合网| 91免费精品国自产拍在线不卡| 中文文精品字幕一区二区| 中文亚洲字幕| 国产真实乱子伦精品视频| 日韩精品最新网址| 最新国产拍偷乱拍精品 | 奶水喷射视频一区| 成人深夜在线观看|