Questions tagged [cuda]

CUDA is a parallel computing platform and programming model for Nvidia GPUs (Graphics Processing Units). CUDA provides an interface to Nvidia GPUs through a variety of programming languages, libraries, and APIs.

Filter by
Sorted by
Tagged with
4
votes
1answer
51 views

CUDA matrix class

I started to work on this CUDA C matrix class to learn both the object oriented programming in C++ and to learn CUDA. The initial goal of this project was to make a matrix class that can have almost ...
1
vote
1answer
61 views

Mirrors number at borders of interval, untill it lays in the interval

I have the following simple function: ...
1
vote
0answers
38 views

Convolutions with shared memory in CUDA

I am writing a noise blur convolution kernel in CUDA ...
0
votes
0answers
57 views

Implemeting multidimensional stencil in Cuda C/C++

I've constructed a system that contains multiple 2D lattice and a 1D cable all in a single vector of type double. Each 2D lattice is coupled to a site along the cable. For instance, there are 800 ...
2
votes
0answers
41 views

Iterator that groups elements of its source

I wrote an iterator to access the pixel in an packed image. It works, but it is slow. 1.Are there any mistakes that can be avoided and might lead to better speed? 2.Are there any pitfalls that ...
8
votes
2answers
305 views

Speeding up Buddhabrot calculation in PyCuda

I've just started using PyCuda with Python 3, but I have some experience in high performance computing on CPU. I've tried to port one of my old models for generating the Buddhabrot to run on my GPU ...
2
votes
0answers
67 views

CUDA kernel to compare matrix entries, weighted with a pattern

I wonder if it's possible to optimize this code in CUDA. Could I get any hints how to? Equivalent algorithm runs faster in Matlab for me, but there I'm doing matrix operations. Compution I'm not ...
8
votes
1answer
1k views

CUDA/C++ Host/Device Polymorphic Class Implementation

I have an abstract class which acts as in interface for a variety of physical models providing Electric/Magnetic Fields as the result of a number of phenomena. I'm wondering if how I've done it is a ...
1
vote
2answers
276 views

Matrix Multiplication Implementation in CUDA C++ API with and without shared memory

Here is my implementation of matrix multiplication using the CUDA C++ API. I tried to separate the source code into multiple files for easier maintenance and readability. matrix.hpp By creating ...
3
votes
0answers
386 views

Complex multiplication and integration with CUDA

I want to perform multiplication on two vectors and integrate it in a vector called acc_y. The acc_y variable will update over ...
3
votes
1answer
972 views

A sleep primitive for CUDA device-side code

I've so far been spared the need to waste any cycles on the GPU, but it seems like this might change. After getting some information I was missing about the semantics of CUDA's ...
6
votes
1answer
2k views

Avoid --compiler-options in makefile using nvcc

I am working with CUDA and I am currently using this makefile to automate my build process. However, there are multiple --compiler-options, basically one for each ...
3
votes
0answers
129 views

Random number generation

I'm trying to port some MonteCarlo code to CUDA (this is my first CUDA experience). The CPU code often calls a function which generates a random number: ...
4
votes
1answer
656 views

GPU and CPU templated matrix classes

I'm learning CUDA C++ (and C++). Can you guys give me some feedback on my basic templated matrix implementation? A brief explanation of my decisions: First things first: I can't use STL classes/...
2
votes
0answers
1k views

Parallel Hillis-Steele Scan using CUDA

I'm learning CUDA (and C to some extent), and one of the algorithms that I am learning is the Hillis-Steele scan algorithm. I wrote a program that performs a simple scan with adding. After seeding ...
3
votes
0answers
186 views

CUDA program that emulates a kind of cellular automata slower on the GPU than on the CPU

I'm a very new to CUDA, so I'm still trying to understand how to make the best use of the GPU. I've ported a C algorithm to it. This algorithm works by loading the memory with an initial input, then ...
2
votes
1answer
649 views

CUDA brute force 48 bit key

I have a cryptographic function with two 24 bit keys. I have two blocks of input and two blocks of output, and want to brute force the keys using CUDA. Overview: The function is composed to two ...
1
vote
0answers
127 views

Cuda C Matrix Compression

I am using Cuda to learn and implement a CSR matrix compression algorithm. What can I do better relating to C's best practices? main.c: ...
4
votes
1answer
201 views

A “policy-based” design for a generic CUDA kernel

I am faced with a design issue that has been discussed on SO several times, the most similar question being this one. Essentially, I want polymorphism for a CUDA kernel in the form of a "generic" ...
3
votes
1answer
707 views

Calculating the distance between several spatial points

I am developing a CUDA program and I want to enhance my performance. I have a kernel function which is consuming more than 70% of execution time. The kernel calculates the distance between several ...
3
votes
0answers
210 views

Parallel reduction by key implementations

I have an implementation of the reduction approach used in this document. Furthermore, I extended (crudely) this so I can reduce-by-key. In my setup I can assume that a ...
18
votes
1answer
1k views

C and CUDA: circular buffer implementation

I have a programme which uses many circular buffers in an identical fashion on a CPU and GPU (C and C/C++ CUDA). I essentially require many queues, however, due to this being run on a GPU, I have ...
5
votes
1answer
1k views

Implementation of AES using CUDA

I am trying to implement AES on GPU using CUDA programming. I use 4 TBoxes in my implementation that requires 4kB of GPU Memory. I have used a 1KB array for 1KB plaintext. first all of plaintext would ...
4
votes
2answers
807 views

Calculating sum of primes using the CPU and GPU

This is a little baffling to me as to why the CUDA code runs about twice as slow as the CPU version. I am just counting all the primes from 0 to (512 * 512 * 512). The CPU version executed in about 97 ...
7
votes
1answer
343 views

CUDA Kernel - Neural Net

I'm building a spiking neural net (recurrent, integrate and fire), and I'm curious about how to reduce the warp divergence (and other problems) I may have. Here's an example with a few hand-placed ...
8
votes
2answers
1k views

Convert a 24bit bitmap to grayscale

I wrote this so I can learn CUDA. This is coded to work on my laptop's Nvidia GeForce GT 540M. Main points I need reviewed: CUDA programming conventions Performance, especially kernel speed C ...
16
votes
2answers
3k views

Generating prime numbers using Sieve of Eratosthenes with CUDA

I'm learning CUDA and wrote a little program which generates prime numbers using the Sieve of Eratosthenes. (I know the limitations of CUDA, specially with memory sizes and limits, but this program is ...
8
votes
1answer
634 views

3D vector CUDA kernel

I designed this CUDA kernel to compute a function on a 3D domain: p and Ap are 3D vectors that are actually implemented as a ...
4
votes
2answers
318 views

Calculating neuron outputs and derivatives

This function runs very often. cudaMemcpy is at the start and works very slowly. How can I change this function to avoid this? I already have ...