Error checking is an important part of every program. We must be able to know when our operations failed, so that we can retry or at the very least log the problem for later analysis.


Error checking in CUDA must be done by hand, fortunately the Toolkit gives us usefully methods to do just that.

Error checking in CUDA

Unfortunately for us, CUDA code runs on the GPU and so, for the concurrent (parallel) code, there is no stack for us to receive errors from, like we’re used to having in C\C++ programs. …

In the recent days a new person has joined my R&D team. This person, call him Bob, has never been in any position where has developed software, but instead has focused on research on an academic level. Being a team that both researches and develops prototypes, it is necessary to give him a quick instruction in software engineering, including best practices, technologies we use and our team’s development habits.

In a world where more and more academics are entering the industry, especially in machine learning R&D positions, there is a greater and greater need to teach those who do the…

Or: going back to basics

This is part 3 of the CUDA programming series, you are welcome to check out the previous posts:

The next few posts will be geared towards understanding key concepts related to general purpose GPU programming in general and CUDA programming in particular. While each post will include some functional code to demonstrate the concept being discussed, their main purpose is to explain the concepts as best as possible.

In short

In this post we will talk about the…

If you haven’t read the first two posts in this series, they are An Overview and An Introduction to the GPU.


The first thing needed for compiling GPU code are the tools that we’ve described in the previous section. The tools are included in the CUDA Toolkit, which can be downloaded and installed here. Depending on your GPU and the driver version, you might need to use an earlier version of the CUDA toolkit.

Please note that the code sections that follow can be compiled for any OS, but were tested on Linux.

I like compiling and profiling the code…

  • Introduction (why care about the hardware)
  • Yours new best friends (common tools)
  • GPU deep dive (useful terms)


If you’re also interested in the motivation behind writing all this, check out part 0.

Unlike most of the programming problems, coding for the GPU requires some understanding of the basic terms and concepts of the hardware itself. This is necessary for two main reasons:

  1. If you’re coding I’m CUDA, you’re looking for speed. While the GPU, generally speaking, will give you a lot of speed, you must know how to utilize the device properly.
  2. Many of the effects and restrictions you see…

CUDA Cube (source: Nvidia)

This series of posts aims to describe a recent project I’ve been working on. The project, among other things, must use CUDA to accelerate the calculations performed. The purpose of this project is to implement the calculation of various graph features, which were previously written in python, in C++.

For those who want to skip my rambling and get to the meat of the series, check out part 1.

Although not the subject of this post, it is worth understanding the motivation behind this project. Graph features are an important part of analyzing data in graph format and being able…

Ori Cohen

A math and computer science enthusiastic.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store