Skip to content

MirruK/GPU-programming-2025

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

Project for GPU programming 2025

Various shader effects implemented in CUDA

Project description

Architecture overview

  • img.hpp/img.cpp
    • Image parsing and writing
    • Image related structs and classes
  • img-utils.cuh
    • Cuda header file with needed declarations for the kernel and setup code
  • setup.cu
    • Setup code for the GPU (mallocs and memcpys)
    • Reading input file (this should be done somewhere else ideally)
    • Writing output file (this should be done somewhere else ideally)
  • convolution-kernel.cu
    • The most unoptimized convolution kernel implementation
    • Right now uses a FILTER_SIZE*FILTER_SIZE blur filter

TODO: Review this architecture and implement

  1. Parse cmd-args
  2. create or read input image(s)
  3. Prepare input / output variables
  4. Allocate memory
  5. Memcpy input contents to GPU
  6. Run the correct shader kernel on the GPU
  7. Collect the result in host memory
  8. Repeat from step 2. for all images
  9. Write output image(s) to disk
  10. cleanup

How to run

Use the Makefile provided by running: make all

This builds the binary, you can then run it using: cat INPUT_FILENAME.ppm | ./build/main [box | gauss | motion] [OUTPUT_FILENAME.ppm]

The output is written to either the specified OUTFILE_NAME.ppm, or output.ppm if nothing else is provided.

TODO: Is this how we want it? ./main -s SHADER_NAME -f FILENAME... -d DIRNAME

The outputs will be placed either in the output directory specified by the -d flag, or into the current directory with the filenames of the outupts in the format output-NNN.ppm

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •