Intel® DPC++ Compatibility Tool

Transform Your CUDA Applications into Standards-Based Data Parallel C++ Code

Code Migration: Before & After

Source CUDA Code

The Intel® DPC++ Compatibility Tool migrates software programs implemented with current and previous versions of CUDA. For details, see the release notes.

#include <cuda.h>
#include <stdio.h>

const int vector_size = 256;

__global__ void SimpleAddKernel(float *A, int offset) 
  A[threadIdx.x] = threadIdx.x + offset;
}int main() 
  float *d_A;
  int offset = 10000;

  cudaMalloc( &d_A, vector_size * sizeof( float ) );
  SimpleAddKernel<<<1, vector_size>>>(d_A, offset);

  float result[vector_size] = { };
  cudaMemcpy(result, d_A, vector_size*sizeof(float), cudaMemcpyDeviceToHost);

  cudaFree( d_A );
  for (int i = 0; i < vector_size; ++i) {
    if (i % 8 == 0) printf( "\n" );
    printf( "%.1f ", result[i] );

  return 0;

Migrated DPC++ Code

This resulting code is typical of what you can expect to see after code is ported. In most cases, code edits and optimizations will be required to complete the code migration.

Get Started


Install and configure the Intel DPC++ Compatibility Toolkit, which is part of the Intel oneAPI Base Toolkit.

Get the Intel® oneAPI Base Toolkit

System Requirements

Try It Out

See how the migration process works using an introductory code sample.

Get Started Guide

Learn More

Access additional samples, tutorials, and training resources.

DPC++ Language

Intel® oneAPI DPC++/C++ Compiler

Download the Toolkit

The Intel® DPC++ Compatibility Tool is included in the Intel® oneAPI Base Toolkit. This foundational set of tools and libraries includes:

  • Familiar tools and languages
  • Advanced analysis and debugging tools
  • Intel® DPC++ Compatibility Tool for CUDA code migration

See All Toolkits

Get It Now



性能因用途、配置和其他因素而异。请访问 了解更多信息。