mirror of
				https://github.com/NVIDIA/cuda-samples.git
				synced 2025-11-04 07:27:49 +08:00 
			
		
		
		
	Bug 5184356: Update the computeMode for remaining 3 samples
This commit is contained in:
		
							parent
							
								
									02fdb070ad
								
							
						
					
					
						commit
						01a62e2bc0
					
				@ -247,7 +247,9 @@ static void parentProcess(char *app)
 | 
			
		||||
        }
 | 
			
		||||
        // This sample requires two processes accessing each device, so we need
 | 
			
		||||
        // to ensure exclusive or prohibited mode is not set
 | 
			
		||||
        if (prop.computeMode != cudaComputeModeDefault) {
 | 
			
		||||
        int computeMode;
 | 
			
		||||
        checkCudaErrors(cudaDeviceGetAttribute(&computeMode, cudaDevAttrComputeMode, i));
 | 
			
		||||
        if (computeMode != cudaComputeModeDefault) {
 | 
			
		||||
            printf("Device %d is in an unsupported compute mode for this sample\n", i);
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -287,7 +287,9 @@ int main(int argc, char **argv)
 | 
			
		||||
        exit(EXIT_WAIVED);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (device_prop.computeMode == cudaComputeModeProhibited) {
 | 
			
		||||
    int computeMode;
 | 
			
		||||
    checkCudaErrors(cudaDeviceGetAttribute(&computeMode, cudaDevAttrComputeMode, dev_id));
 | 
			
		||||
    if (computeMode == cudaComputeModeProhibited) {
 | 
			
		||||
        // This sample requires being run with a default or process exclusive mode
 | 
			
		||||
        fprintf(stderr,
 | 
			
		||||
                "This sample requires a device in either default or process "
 | 
			
		||||
 | 
			
		||||
@ -322,7 +322,9 @@ static void parentProcess(char *app)
 | 
			
		||||
        }
 | 
			
		||||
        // This sample requires two processes accessing each device, so we need
 | 
			
		||||
        // to ensure exclusive or prohibited mode is not set
 | 
			
		||||
        if (prop.computeMode != cudaComputeModeDefault) {
 | 
			
		||||
        int computeMode;
 | 
			
		||||
        checkCudaErrors(cudaDeviceGetAttribute(&computeMode, cudaDevAttrComputeMode, i));
 | 
			
		||||
        if (computeMode != cudaComputeModeDefault) {
 | 
			
		||||
            printf("Device %d is in an unsupported compute mode for this sample\n", i);
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user