This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__kernel void vector_sort(__global int *A, __global int *B) { | |
//Get the index of the current element | |
int i = get_global_id(0); | |
int size = 1024; //We can change the size of array to 2048, 4096, 8192, 16384 and 32768 | |
int j = 0; | |
// Do the operation of sorting | |
int p = 0; | |
for(j = 0; j < size; j++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__kernel void vector_add(__global int *A, __global int *B, __global int *C) { | |
//Get the index of the current element | |
int i = get_global_id(0); | |
int size = 1024; | |
//Initialize the two input vectors | |
A[i] = i; | |
B[i] = size - i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <time.h> | |
#include <cuda.h> | |
// Thread block size | |
#define BLOCK_SIZE 512 | |
// Size of Array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(*The signature includes the total number of 2-double-bed romms,queen-bed rooms and king-bed rooms accordingly | |
in a hotel. Also the requirements of minimum number of nights and number limit of occupancy must be met by | |
any reservation*) | |
signature ROOMDETAIL = | |
sig | |
val doubleAvailable:int; | |
val queenAvailable:int; | |
val kingAvailable:int; | |
val minnights:int option; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <time.h> | |
#include <cuda.h> | |
// block size | |
#define BLOCK_SIZE 512 | |
#define VECTOR_SIZE 100 // We can change the value of W to 200, 400, 800, 1600, 3200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <time.h> | |
#include <cuda.h> | |
// Thread block size | |
#define BLOCK_SIZE 8 //We can change this to 16, 32, 64, 128, 256, 512 and 1024 | |
// Matrix dimensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
#include<ctype.h> | |
#include<string.h> | |
#include<string> | |
#include<iostream> | |
#include<numeric> | |
#include<algorithm> | |
#include<list> | |
#include<functional> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<stdlib.h> | |
#include<ctype.h> | |
#include<string.h> | |
#include<string> | |
#include<iostream> | |
using namespace std; | |
#define MAX 1000 |