ocelot/ocelot/cuda/implementation/CudaRuntime.cpp
cudaError_t cuda::CudaRuntime::cudaMallocHost(void **ptr, size_t size) {
	cudaError_t result = cudaErrorMemoryAllocation;
	_acquire();
	if (_devices.empty()) return _setLastError(cudaErrorNoDevice);
	
	try {
		executive::Device::MemoryAllocation* 
			allocation = _getDevice().allocateHost(size);
		*ptr = allocation->mappedPointer();
		result = cudaSuccess;
	}
	catch(hydrazine::Exception &exp) {
		report("  cudaMallocHost() - error:\n" << exp.what());
	}

	report("cudaMallocHost( *pPtr = " << (void *)*ptr 
		<< ", size = " << size << ")");
		
	_release();
	return _setLastError(result);
}
/*!
	constructs a host-side allocation, returns pointer to mapped region -
	this allocation is referenced by the mappedPointer()
*/
constructs a host-side allocation, returns pointer to mapped region
this allocation is referenced by the mappedPointer()
constructs a host - side allocation returns pointer to mapped region this allocation is referenced by the mappedPointer ()
cudaError_t cuda::CudaRuntime::cudaMallocHost(void **ptr, size_t size) {
	cudaError_t result = cudaErrorMemoryAllocation;
	_acquire();
	if (_devices.empty()) return _setLastError(cudaErrorNoDevice);
	try {
		executive::Device::MemoryAllocation* 
			allocation = _getDevice().allocateHost(size);
		*ptr = allocation->mappedPointer();
		result = cudaSuccess;
	}
	catch(hydrazine::Exception &exp) {
		report("  cudaMallocHost() - error:\n" << exp.what());
	}
	report("cudaMallocHost( *pPtr = " << (void *)*ptr 
		<< ", size = " << size << ")");
	_release();
	return _setLastError(result);
}
cudaError_t cuda :: CudaRuntime :: cudaMallocHost ( void * * ptr , size_t size ) { cudaError_t result = cudaErrorMemoryAllocation ; _acquire ( ) ; if ( _devices . empty ( ) ) return _setLastError ( cudaErrorNoDevice ) ; try { executive :: Device :: MemoryAllocation * allocation = _getDevice ( ) . allocateHost ( size ) ; * ptr = allocation -> mappedPointer ( ) ; result = cudaSuccess ; } catch ( hydrazine :: Exception & exp ) { report ( " \n " << exp . what ( ) ) ; } report ( " " << ( void * ) * ptr << " " << size << " " ) ; _release ( ) ; return _setLastError ( result ) ; }
constructs a host-side allocation, returns pointer to mapped region
this allocation is referenced by the mappedPointer()
constructs a host - side allocation returns pointer to mapped region this allocation is referenced by the mappedPointer ()