Skip to content

Instantly share code, notes, and snippets.

View teju85's full-sized avatar

Thejaswi. N. S teju85

View GitHub Profile
@teju85
teju85 / sudoku-3x3.cpp
Created August 23, 2019 16:28
Solve sudoku 3x3 boards using only elimination techniques
//
// Compilation: g++ -std=c++11 -o a.exe sudoku-3x3.cpp
// Run: ./a.exe "7 1 8 19 5 812 5 372 7 4 652 3 938 5 14 2 5 7"
// In order to solve the following board:
//
// 7 0 1 0 0 0 0 0 8
// 0 0 0 1 9 0 0 0 5
// 0 0 0 0 0 8 1 2 0
//
// 0 0 0 0 5 0 3 7 2
@teju85
teju85 / device-prop-test.cu
Last active September 16, 2020 18:34
Sample example to compare perf of cudaGetDeviceProperties and cudaDeviceGetAttribute
// Compiling and running this program:
// nvcc -std=c++11 device-prop-test.cu && ./a.out
#include <chrono>
#include <iostream>
using namespace std;
#define CUDA_CHECK(call) \
do { \
cudaError_t status = call; \
if(status != cudaSuccess) { \