
For above programm, it works correctly , you will have to place
cudaThreadSynchronize() before the timer stops.
6. Write a part of the CUDA program which can calculate the time of execution of CUDA kernel. . W...
4A. Write a CUDA host program that reads a character type matrix A and integer type matrix B of size mxn. It produces an output string STR such that, every character of A is repeated n times (where n is the integer value in matrix B which is having the same index as that of the character taken in A). Solve this using 1D Block. Example: 1 2 4 3 e X a M Output String STR: pCCaaaaPPPeeXXXXaaaMM 4B. Write...
Write a program that obtains the execution time of selection sort, radix sort, bubble sort, merge sort, quick sort, and heap sort for input size 50000, 100,000, 150,000, 200,000, 250,000, and 300,000. Your program should create data randomly and print a table like this: In the same program, obtain the execution time of selection sort, radix sort, bubble sort, and heap sort for input size 2,000,000, 3,000,000, 4,000,000, and 5,000,000. (Hint: You can use the code template below to obtain...
Please finish all 6 parts. Don't need to do the measure time
things, but you can do it if you wanna do it. Thanks!
Write the following SQL queries and measure their execution time both with and without using indexes 1. Count how many parts in NYC have more than 70 parts on hand 2. Count how many total parts on hand, in both NYC and SFO, are Red 3. List all the suppliers that have more total on _hand...
Write a program in Java that obtains the execution time of selection sort, insertion sort, bubble sort, merge sort, quick sort, and radix sort. Your program should test all sort methods for input sizes of 10000, 20000, 30000, 40000, 50000, and 60000. The selection sort, bubble sort, and radix sort should also be tested for input sizes 100000 and 200000. Your program should create the data that is sorted from randomly generated integers and should output the results in a...
C++
Write a program to calculate the sum of two matrices that are
stored inside two-dimensional arrays. Your program should include
three functions: one for getting input data, one for calculating
the sum of matrices, and one for printing the result.
a) Function inputMatrix: This Function prompts the user to enter
the data and stores data inside two-dimensional array.
b) Function addMatrices: This function calculatesthe sum result
of two matrices.
c) Function printMatrix: This function prints the matrix to
screen....
Write a program that compares the execution speed of two different sorting algorithms: bubble sort and selection sort. It should do this via functions you must write with the following prototypes: void setRandomValues(int[], int[], int length); This function sets two integer arrays with identical random values. The first two arguments are two integer arrays of the same length, and the third argument is the length of those arrays. The function then sets each element in the first and second argument...
In java please
Program 5.1: Properties of a Relation Write a program that can determine which, if any, of the following properties a binary matrix exhibits: symmetric anti-symmetric asymmetric (from the textbook) reflexive or anti-reflexive (or neither of course) Program Requirements: Hard code at least 4 binary matrices all of size 4x4. Display each binary matrix and the the properties it exhibits. For example: A 0 100 0 00 0 0000 0 000 A anti-reflexive, anti-symmetric, asymmetric B 11 10...
Please write in the Julia Language. Consider a steel rod.
Write a program which will calculate the temperature profile in the
rod using a finite difference scheme. The user should enter the
length of the rod (L), the value for k (= 65 W/mK), and a value for
q in W/m^3. The user should also enter the number of intervals N
,(so you can calculate Δx=L/N). The user should also enter the end
temperatures.
Your program should create the matrix...
Write a program mexp that multiplies a square matrix by itself a specified number of times、mexp takes a single argument, which is the path to a file containing a square (k × k) matrix M and a non-negative exponent n. It computes M and prints the result Note that the size of the matrix is not known statically. You ust use malloc to allocate space for the matrix once you obtain its size from the input file. Tocompute M". it...
18.1 Lab Lesson 11 (Part 1 of 1) Part of lab lesson 11 There in one part to lab lesson 11. The entire lab will be worth 100 points. Lab lesson 11 part 1 is worth 100 points For part 1 you will have 80 points if you enter the program and successfully run the program tests. An additional 20 points will be based on the style and formatting of your C++ code. Style points The 20 points for coding...