Thrust error on min_element or max_element

Problem

I was compiling some old CUDA code with a recent version of the CUDA SDK. I got these errors on Thrust methods:

error: namespace thrust has no member max_element
error: namespace thrust has no member min_element

Solution

In recent versions of CUDA SDK, these Thrust methods have been moved to the extrema.h header file. These errors will go away if you include the thrust/extrema.h header file.

Tried with: CUDA SDK 7.5 and Ubuntu 14.04

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s