Skip to content

Instantly share code, notes, and snippets.

View sachith-1's full-sized avatar
🎯
Focusing

Sachith sachith-1

🎯
Focusing
View GitHub Profile
@sachith-1
sachith-1 / cp_template.py
Created October 20, 2019 08:09 — forked from NicolasBizzozzero/cp_template.py
Competitive Programming template for Python 3 files, with a GPLv3 header.
""" Answer a specific exercise of a programming contest.
This module contains all the code needed to answer a given exercise during a
programming contest. Due to its quick creation and the fact that it's probably
not following proper Python guidelines (as described in multiples PEP
documents), it shouldn't be used in production.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
npm i -g @neutralinojs/neu
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
#include <stdlib.h>
__global__ void getSum(int *n1, int *n2, int *sumData) {
*sumData = *n1 + *n2;
}
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
#include <stdlib.h>
#define N 200
void dataToArray(int* a, int n){
int i;
__global__ void helloCuda(int *num1, int *num2, int *sum){
printf("Hello World from CUDA GPU!\n");
*sum = *num1+*num2;
}
kernel_name<<<Dg,Db>>>
dim3 Dg;
Dg.x = 2;
Dg.y = 2;
Dg.z = 1;
// also can be written as
// Dg(2,2,1);
dim3 Db(2,4,2);
hello_cuda<<<Dg,Db>>>();
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
#include <stdlib.h>
__global__ void getSum (int *n1, int *n2, int *sumData){
*sumData = *n1 + *n2;
}