This file contains 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
// curl -X POST -H "Content-Type: application/octet-stream" --data-binary '@filename' http://127.0.0.1:5050/upload | |
package main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
"os" | |
"time" |
This file contains 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 <stdlib.h> | |
#include <stdio.h> | |
#include <hb.h> | |
int main(int argc, char **argv) { | |
FILE *f = fopen("/Library/Fonts/Tahoma.ttf", "rb"); | |
fseek(f, 0, SEEK_END); | |
long fsize = ftell(f); | |
fseek(f, 0, SEEK_SET); |
This file contains 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 "device_launch_parameters.h" | |
#include "device_functions.h" | |
#include <stdio.h> | |
void print(char*, int[], int); | |
__global__ void square(int *a) { // our computation logic, will be run on GPU | |
a[threadIdx.x] *= a[threadIdx.x]; |
This file contains 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 "device_launch_parameters.h" | |
#define __CUDACC__ | |
#include "device_functions.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
void print(char*, int[], int); |
This file contains 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
// `clang a.c && time ./a.out` | |
// real 0m0.071s | |
// user 0m0.067s | |
// sys 0m0.002s | |
// `clang -O3 a.c && time ./a.out` | |
// real 0m0.029s | |
// user 0m0.025s | |
// sys 0m0.001s | |
// `gcc-6 a.c && time ./a.out` | |
// real 0m0.093s |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.