Skip to content

Instantly share code, notes, and snippets.

View harsha5500's full-sized avatar

Harsha Krishna harsha5500

View GitHub Profile
@harsha5500
harsha5500 / torch_test_cuda.py
Created July 29, 2023 05:54
Test if pytorch has cuda enabled.
# Simple test to check if pytorch is installed and can create matrices
import torch
x = torch.rand(5, 3)
print(x)
print("\n")
if torch.cuda.is_available():
print("Is PyTorch CUDA installed: " + str(torch.cuda.is_available()))
print("Number of Cuda Devices: " + str(torch.cuda.device_count()))
@harsha5500
harsha5500 / Makefile
Created July 29, 2023 05:53
Makefile for Macos M1
# Makefile template to compile SLD2 sources on Apple m1 with compile and installed libraries
all:
arch -arm64 cc -c src/filehandler.c -I include
arch -arm64 cc -c src/main.c -I include -I /usr/local/include/SDL2
arch -arm64 cc -o hl1038 main.o filehandler.o -L /usr/local/lib -lsdl2 -lsdl2_image -lsdl2_ttf
clean:
rm filehandler.o
rm main.o
@harsha5500
harsha5500 / .vimrc
Created July 29, 2023 05:52
My VIM configuration
" turn on syntax highlighting
syntax on
" turn on line numbers
set nu
set tabstop=4 "Tab space is 4
set shiftwidth=4
set softtabstop=0
set noexpandtab
@harsha5500
harsha5500 / .gitignore
Last active July 29, 2023 05:52
Gitignore template
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*