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
/* Floating Point 4x4 Matrix Multiplication */ | |
.global _start | |
_start: | |
LDR R0, =matrix0 | |
LDR R1, =matrix1 | |
LDR R2, =matrix2 |
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 <chrono> | |
#include <iostream> | |
#include <vector> | |
#include <thread> | |
__global__ void do_nothing(int time_us, int clock_rate) { | |
clock_t start = clock64(); | |
clock_t end; | |
for (;;) { | |
end = clock64(); |
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 <limits.h> | |
#include <unistd.h> | |
#include <csignal> | |
#include <cstdlib> | |
#include <fstream> | |
#include <iostream> | |
#include <iostream> | |
#include <sstream> | |
#include <stdexcept> |
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
// 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) { \ |
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
''' | |
Memory profiling utilities | |
''' | |
import gc | |
import inspect | |
import linecache | |
import os.path | |
import sys | |
import time | |
import threading |
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
''' | |
Memory profiling utilities | |
''' | |
import gc | |
import inspect | |
import linecache | |
import os.path | |
import sys | |
import time | |
import threading |
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 tensorrt as trt | |
import numpy as np | |
import pycuda.autoinit | |
import pycuda.driver as cuda | |
import time | |
model_path = "model.onnx" | |
input_size = 32 | |
TRT_LOGGER = trt.Logger(trt.Logger.WARNING) |
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 onnx | |
import sys | |
name = sys.argv[1] | |
model = onnx.load(name) | |
onnx.checker.check_model(model) | |
print(onnx.helper.printable_graph(model.graph)) |