Problems with CUDA on mac

I have installed CUDA 8.0 as shown in here
and every thing went smoothly, but every time I type “global” the Xcode rejects if CUDA wasn’t installed
I’m using Xcode 7.3.1 , CUDA 8.0 , OS X 10.11.6, standard C , command line tools are installed ,

Does Xcode requires some sort of setting to work with CUDA ?

If there was no way to run CUDA on Xcode can it run eclipse or intel parallel studio ? what is the procedure ?
thank you for your help .

Have you followed the verification steps in the CUDA 8.0RC install guide for Mac?

Yes and all verifies ok, then I tried also eclipse nsight release 8 but it doesn’t compile any thing and says “launch failed. Binary not found”

Very well. In section 4.3 of that guide, in the Verification chapter, it advises you to run the deviceQuery sample, and shows what correct output should look like.

What output did you get? (You can copy and paste it into your answer.)

Last login: Wed Aug 3 17:24:08 on ttys001
/Developer/NVIDIA/CUDA-8.0/samples/bin/x86_64/darwin/release/deviceQuery ; exit;
Ahmeds-MBP:~ ahmedezzat$ /Developer/NVIDIA/CUDA-8.0/samples/bin/x86_64/darwin/release/deviceQuery ; exit;
/Developer/NVIDIA/CUDA-8.0/samples/bin/x86_64/darwin/release/deviceQuery Starting…

CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL
Saving session…
…copying shared history…
…saving history…truncating history files…

[Process completed]

So I would suggest that all did not verify OK, contrary to your statement.

The driver version you have installed is incorrect for CUDA 8.

This issue is probably separate from your question about Xcode. But since you haven’t followed the installation guide correctly, you may want to try and do that, as it indicates various system requirements.

I have installed also cuda 7.5 and this is the results

/Developer/NVIDIA/CUDA-7.5/samples/bin/x86_64/darwin/release/deviceQuery Starting…

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: “GeForce GT 650M”
CUDA Driver Version / Runtime Version 7.5 / 7.5
CUDA Capability Major/Minor version number: 3.0
Total amount of global memory: 1024 MBytes (1073414144 bytes)
( 2) Multiprocessors, (192) CUDA Cores/MP: 384 CUDA Cores
GPU Max Clock rate: 900 MHz (0.90 GHz)
Memory Clock rate: 2508 Mhz
Memory Bus Width: 128-bit
L2 Cache Size: 262144 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 1 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 7.5, CUDA Runtime Version = 7.5, NumDevs = 1, Device0 = GeForce GT 650M
Result = PASS
Saving session…
…copying shared history…
…saving history…truncating history files…

[Process completed]

But still doesn’t compile

For CUDA 7.5 (which now appears to be installed correctly) these are the requirements:

Your Xcode version that you list in your first comment (7.3.1) doesn’t appear to match the requirements.

Please follow the installation guide carefully.