30 lines · plain
1// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify=host \2// RUN: -verify-ignore-unexpected=note %s3// RUN: %clang_cc1 -std=c++11 -fcuda-is-device -fsyntax-only -verify=dev \4// RUN: -verify-ignore-unexpected=note %s5 6// Check that we can reference (get a function pointer to) a __global__7// function from the host side, but not the device side. (We don't yet support8// device-side kernel launches.)9 10// host-no-diagnostics11// dev-no-diagnostics12 13#include "Inputs/cuda.h"14 15struct Dummy {};16 17__global__ void kernel() {}18 19typedef void (*fn_ptr_t)();20 21__host__ __device__ fn_ptr_t get_ptr_hd() {22 return kernel;23}24__host__ fn_ptr_t get_ptr_h() {25 return kernel;26}27__device__ fn_ptr_t get_ptr_d() {28 return kernel;29}30