Latest in C & C++

C & C++ at a glance

The 10 latest articles on C & C++ come from 3 sources, all published Nov 12. Most come from nvidia.github.io (6) and DEV Community (3).

Organizations: GCC (2)

240 words

thrust::operator+#

Overloads# operator+(x, y)# template complex thrust::operator+( const complex &x, const complex &y )# Adds two complex numbers. The value types of the two complex types should be compatible and the type of the returned complex is the promoted type of…

193 words

thrust::malloc#

template pointer thrust::malloc( const thrust::detail::execution_policy_base &system, std::size_t n )# This version of malloc allocates typed uninitialized storage associated with a given system. The following code snippet demonstrates how to use malloc to allocate a range of memory to accommodate…

147 words

thrust::device_malloc#

template device_ptr thrust::device_malloc( const std::size_t n )# Allocates sequential device storage for new objects of a given type, or raw bytes if the type is void. The following code snippet demonstrates how to use device_malloc to allocate a range of device memory. #include…

1,031 words

Linking TUs compiled with different architectures#

Consider the following simple library: template __host__ __device__ constexpr int sum_archs() noexcept { return (Archs +... + 0); } // kernel with architecture dependent symbol name and functionality template __global__ void kernel(T *val) { *val = sum_archs(); } __attribute__((visibility("hidden"))) inline int use_kernel() { int *d_val{}; cudaMalloc(&d_val, sizeof(d_val)); kernel(d_val); int ret; if (cudaMemcpy(&ret, d_val, sizeof(size_t), cudaMemcpyDeviceToHost)!

251 words

thrust::operator-#

Overloads# operator-(x, y)# template complex thrust::operator-( const complex &x, const complex &y )# Subtracts two complex numbers. The value types of the two complex types should be compatible and the type of the returned complex is the promoted type of…

240 words

thrust::operator==#

Overloads# operator==(x, y)# template bool thrust::operator==( const complex &x, const complex &y )# Returns true if two complex numbers are equal and false otherwise. Added in version 2.2.0. Parameters: x – The first complex. y – The second complex. operator==(x, y)# template…

C & C++

Systems, embedded, toolchains, and modern C/C++ evolution.

  • 8 Tracked terms
  • Last 30 days Feed window

What this topic collects on

An article joins this feed when it matches these terms. Each one is also a search of its own.