This file contains hidden or 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
import multiprocessing as mp | |
import time as time | |
def square(): | |
for i in range(1000000): | |
x = pow(i, 2) | |
if __name__ == "__main__": | |
num_iter = 10 | |
start = time.time() |
This file contains hidden or 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
import threading | |
import time as time | |
def square(): | |
for i in range(1000000): | |
x = pow(i, 2) | |
if __name__ == "__main__": | |
num_iter = 10 | |
start = time.time() |
This file contains hidden or 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 <iostream> | |
#include <chrono> | |
#define BLOCK_SIZE 256 | |
inline void gpuAssert(cudaError_t err, const char *file, int line) | |
{ | |
if (err != cudaSuccess){ | |
printf("%s in %s at line %d\n", cudaGetErrorString(err), file, line); | |
exit(EXIT_FAILURE); |
This file contains hidden or 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 <cuda.h> | |
#include <stdio.h> | |
#define BLOCK_SIZE 32 | |
#define NUM_REPS 100 | |
inline void gpuAssert(cudaError_t err, const char *file, int line) | |
{ | |
if (err != cudaSuccess){ | |
printf("%s in %s at line %d\n", cudaGetErrorString(err), file, line); | |
exit(EXIT_FAILURE); |
This file contains hidden or 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 <cooperative_groups.h> | |
#include <algorithm> | |
#include <cuda.h> | |
#include<stdio.h> | |
using namespace cooperative_groups; | |
inline void gpuAssert(cudaError_t err, const char *file, int line) | |
{ | |
if (err != cudaSuccess){ |
This file contains hidden or 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 <chrono> | |
#include <iostream> | |
#define BLOCK_SIZE 128 | |
inline void gpuAssert(cudaError_t err, const char *file, int line) | |
{ | |
if (err != cudaSuccess){ | |
printf("%s in %s at line %d\n", cudaGetErrorString(err), __FILE__, __LINE__); |
This file contains hidden or 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 <iostream> | |
#include <chrono> | |
#define BLOCK_SIZE 256 | |
#define GRID_SIZE 72 //Turing Titan RTX | |
#define OUT_SIZE 256 | |
inline void gpuAssert(cudaError_t err, const char *file, int line) | |
{ |
This file contains hidden or 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
import torch | |
import torch.nn as nn | |
import copy | |
import torchvision.models as models | |
class BN_Folder(): | |
def fold(self, model): | |
mymodel = copy.deepcopy(model) | |
mymodel.eval() |
This file contains hidden or 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 "omp.h" | |
#include <thread> | |
#include <iostream> | |
#include <vector> | |
#include <chrono> | |
void doNothing(){ | |
int count =0; | |
for (int i=0; i<1000; ++i) |
This file contains hidden or 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 <csignal> | |
#include <cstdlib> | |
#include <fstream> | |
#include <iostream> | |
#include <unistd.h> | |
#include <limits.h> | |
#include <iostream> | |
#include <sstream> | |
#include <stdexcept> |
NewerOlder