CUDA Native programming model

Assignment Help Programming Languages
Reference no: EM133090134

Question: Rank Sort 

This algorithm finds the rank of each number in an array and places it in order in a second array. This isn't a good sequential algorithm (0(N2)), but there is plenty of parallelism as the iterations of the inner loop can be done independently:

function ranksort(a)
a = length(a)
b = similar(a)
for i in 1:n
idx =0
einbounds for J in 1:n
a[i] > a[J] && (idx += 1)
end
b(idx+1] = a[i]
end
return b
end

Your task is to parallelize this algorithm for CPU execution in two ways:

1. With Julia's CUDA Native programming model, replacing the inner loop with a call to a CUDA kernel. The function must include a parameter chunkSize, which is the munber of iterations assigned to each thread.

2. With Julia's CuArrays programming model, replacing the inner loop with Julia's broadcast/dot notation. To do this you'll need to write the comparison moults to a temporary array and then sum this array using the CUDA/Julia sum() function.

Test your functions for correctness and benchmark them on Mach2. Please note that the second function will give poor performance. See if you can optimize it but don't be disappointed if it's still slower than the CPU version. Test your first function with a few chunk sizes varying from 1 to 128 and for two arrays of different sizes with at least 218 floats. Don't forget to test for correctness! Compare the performance of both functions (in Maps, based on n2 + n array operations) with the performance of the sequential ranksort().

To pass in the assignment: Submit a .zip file of your source code and a single pdf document containing listings of your code and output from your testing, and submit it via D2L. Name your document LastNanefirstName A3.pdf (LastNtune and FirstName are of course substituted with your last and first name).

Reference no: EM133090134

Questions Cloud

What is the cost per mile for this car : The sales tax is 6.5 percent and you intend to use the car for four years. You drive 10,000 miles per year. What is the cost per mile for this car
How much does it cost to operate this car : Assume you and your spouse were recently married and bought your first car, a used Toyota, for $10,000. How much does it cost to operate this car
Describe how each influence lives of others positively : Describe how each influence the lives of others positively and/or negatively. Provide leadership similarities and differences of the two leaders.
What is the minimum transfer price : Fixed cost per unit of the component is $25. What is the minimum transfer price if the division is operating at capacity
CUDA Native programming model : CUDA Native programming model, replacing the inner loop with a call to a CUDA kernel. The function must include a parameter chunkSize, which is the munber
What is the pension expense : The Sophia Company adopted a defined benefit pension plan on January 1, 2015, What is the pension expense for 2015
Member current behaviour : One of the members of your team continually arrives late for meetings and does not turn drafts of assignments in on time. Choose one of the available theories a
Consider the metrics of targeting : Consider the metrics of targeting, temporary, special, and irregular promotions.
Project scheduling : "Market pressures, competition among rivals become brutal in the contemporary time.

Reviews

len3090134

2/21/2022 9:46:30 PM

Julia language- Parallel computing. check attachment. as a result I should receive 2 running codes , with screenshots of the running codes out put(output includes the sorted array of 10 thousand elements and the time and memory consumed to run each code- this can be done by a small function in Julia called @btime). the array to be calculated should have 10000 elements. numbers in the array should be in the range 0-9999 (randomly). Follow the instructions in the assignment to know how to build the codes.

Write a Review

Programming Languages Questions & Answers

  Rewrite the code using a select case block

Rewrite the code using a Select Case block and Determine the output displayed in the text box when the button is clicked

  Write a program to simulate deterministic finite automaton

Write a program to simulate any deterministic finite automaton. The set of states includes q0, q1, q2, ..., and the set of final states are in the input also.

  Project - converting pounds to kilograms calculator

Create classes and objects that access variables and modifier keywords. Develop methods using parameters and return values

  Describes the function of the program

ITECH1000 Programming Assignment. This stage requires you to prepare documentation that describes the function of the program and how it is to be tested

  Write program to give functionality to process movie rentals

Your first procedure is to be named MOVIE_RENTAL_SP and is going to give functionality to process movie rentals. Based on data which will represent movie id, member id and payment method.

  Design a class for string field for toppings

Design a class named pizza. Data fields include a string field for toppings (such as pepperoni) and numeric fields for diameter in inches (such as 12) and price (such as 13.99).

  Create a program to compute car-s miles-per-gallon

Create a program which ask's the user for number of miles driven and gallons of gas used. It must compute the car's miles-per-gallon and show the result on the screen.

  Creating a text-based program for storing data

ITECH5403 - Parallel Implementations - Creating a text-based program for storing data on Hotel Room Bookings - however, as this is a comparative languages

  Design pre-post conditions for required operations

Design Pre/Post conditions for required operations; A recursive method named postfix that outputs the expression represented by a non-empty expression tree in postfix format.

  Create a formula to have excel compute annual savings

You do not need to put in personal information or actual values if you do not wish, but you must include some data for each of the various categories and income and expense line items.

  Iimplement a class called monetarycoin

Create an implement a class called MonetaryCoin that is derived from the class Coin class. Store a value in the in the monetary coin that represents its value.

  How to produce javascript code

Using the prompt and alert functions, invite the user to input 5 marks (integers) in the range 0-100.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd