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
| // relu | |
| extern "C" __global__ void kern(float* d1, float* result) { | |
| int idx = blockIdx.x * blockDim.x + threadIdx.x; | |
| float d2 = d1[idx]; | |
| result[idx] = d2 > 0 ? d2 : 0.0; | |
| } |
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
| digraph mnist { | |
| { | |
| // params | |
| node [style=filled, fillcolor=green, fontcolor=white, shape=box]; | |
| w1[label="w1 (784, 1000)"]; | |
| w2[label="w2 (1000, 1000)"]; | |
| w3[label="w3 (1000, 10)"]; | |
| } |
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_runtime.h> | |
| #include <stdio.h> | |
| #define CHECK_CUDA_ERROR(call) { \ | |
| cudaError_t e = call; \ | |
| if (e != cudaSuccess) { \ | |
| snprintf(err_buf, 256, "CUDA[%d]: %d: %s\n", __LINE__, e, cudaGetErrorString(e)); \ | |
| return; \ | |
| } \ | |
| } |
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
| FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 | |
| ENV NVIDIA_VISIBLE_DEVICES=all | |
| ENV NVIDIA_DRIVER_CAPABILITIES=all | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # configure locale | |
| ENV LANG en_US.UTF-8 | |
| ENV LANGUAGE en_US:en | |
| ENV LC_ALL en_US.UTF-8 |
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
| export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin | |
| source /usr/share/bash-completion/bash_completion |