idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
4,000
static BeanDefinitionBuilder startClientBuilder ( Class beanClass , String properties , boolean forceMapping , boolean forceTemplate , boolean mergeMapping , boolean mergeSettings , boolean autoscan , String classpathRoot , String mappings , String aliases , String templates , String async , String taskExecutor ) { Bea...
Managing common properties for TransportClient
4,001
private String getAdaptiveUrl ( FileLink fileLink , int dimen ) { ResizeTask resizeTask = new ResizeTask . Builder ( ) . fit ( "crop" ) . align ( "center" ) . width ( dimen ) . height ( dimen ) . build ( ) ; return fileLink . imageTransform ( ) . addTask ( resizeTask ) . url ( ) ; }
Creates a URL to an image sized appropriately for the form ImageView
4,002
private void selectImage ( ) { String apiKey = getString ( R . string . filestack_api_key ) ; if ( apiKey . equals ( "" ) ) { throw new RuntimeException ( "Create a string res value for \"filestack_api_key\"" ) ; } Config config = new Config ( apiKey , "https://form.samples.android.filestack.com" ) ; Context context = ...
Handles user clicking select button launches the picker UI
4,003
private void createAccount ( ) { String name = nameView . getText ( ) . toString ( ) ; ( ( MainActivity ) getActivity ( ) ) . setComplete ( name ) ; }
Handles user clicking create button calls on activity to handle swapping fragments
4,004
public static String trimLastPathSection ( String path ) { String [ ] sections = path . split ( "/" ) ; StringBuilder newPath = new StringBuilder ( "/" ) ; for ( int i = 1 ; i < sections . length - 1 ; i ++ ) { newPath . append ( sections [ i ] ) . append ( "/" ) ; } return newPath . toString ( ) ; }
Removes the last part of a file path .
4,005
public static File createPictureFile ( Context context ) throws IOException { Locale locale = Locale . getDefault ( ) ; String timeStamp = new SimpleDateFormat ( "yyyyMMdd_HHmmss" , locale ) . format ( new Date ( ) ) ; String fileName = "JPEG_" + timeStamp + "_" ; File storageDir = context . getExternalFilesDir ( Envir...
Create a file with a path appropriate to save a photo . Uses directory internal to app .
4,006
public static void addMediaToGallery ( Context context , String path ) { Intent mediaScanIntent = new Intent ( Intent . ACTION_MEDIA_SCANNER_SCAN_FILE ) ; File f = new File ( path ) ; Uri contentUri = Uri . fromFile ( f ) ; mediaScanIntent . setData ( contentUri ) ; context . sendBroadcast ( mediaScanIntent ) ; }
Make media accessible outside the app .
4,007
public static void initializeClient ( Config config , String sessionToken ) { Config overridenConfig = new Config ( config . getApiKey ( ) , "filestack://done" , config . getPolicy ( ) , config . getSignature ( ) ) ; client = new Client ( overridenConfig ) ; client . setSessionToken ( sessionToken ) ; }
Create the Java SDK client and set a session token . The token maintains cloud auth state .
4,008
public static boolean mimeAllowed ( String [ ] filters , String mimeType ) { return MimeTypeFilter . matches ( mimeType , filters ) != null ; }
Returns true if the MIME type is allowed by the filters .
4,009
public void setLoading ( boolean isLoading ) { getSupportFragmentManager ( ) . beginTransaction ( ) . replace ( R . id . root , isLoading ? loadingFragment : formFragment ) . commit ( ) ; }
Swap between showing the form and loading fragments
4,010
public void setComplete ( String name ) { CompleteFragment fragment = CompleteFragment . create ( name ) ; getSupportFragmentManager ( ) . beginTransaction ( ) . replace ( R . id . root , fragment ) . commit ( ) ; }
Show the complete fragment when an account has been created
4,011
public void reset ( ) { fileLink = null ; formFragment = new FormFragment ( ) ; getSupportFragmentManager ( ) . beginTransaction ( ) . replace ( R . id . root , formFragment ) . commit ( ) ; }
Remove the complete fragment and show an empty form fragment
4,012
void saveState ( Bundle outState ) { outState . putString ( STATE_CURRENT_PATH , currentPath ) ; outState . putSerializable ( STATE_FOLDERS , folders ) ; outState . putSerializable ( STATE_NEXT_TOKENS , nextTokens ) ; }
Save the items we ve loaded on orientation changes etc
4,013
public boolean hasSubscriptions ( ) { return ! disposedInd && ( ( bindings != null && ! bindings . isEmpty ( ) ) || ( compBindings != null && ! compBindings . isEmpty ( ) ) ) ; }
Returns true if this composite is not disposed and contains Bindings .
4,014
public static < T > FlowableTransformer < T , T > doOnErrorFx ( Consumer < Throwable > onError ) { return obs -> obs . doOnError ( e -> runOnFx ( e , onError ) ) ; }
Performs a given action on a Throwable on the FX thread in the event of an onError
4,015
public static < T > FlowableTransformer < T , T > doOnNextCountFx ( Consumer < Integer > onNext ) { return obs -> obs . compose ( doOnNextCount ( i -> runOnFx ( i , onNext ) ) ) ; }
Performs an action on FX thread on onNext with the provided emission count
4,016
public static < T > FlowableTransformer < T , T > doOnCompleteCountFx ( Consumer < Integer > onComplete ) { return obs -> obs . compose ( doOnCompleteCount ( i -> runOnFx ( i , onComplete ) ) ) ; }
Performs an action on FX thread on onCompleted with the provided emission count
4,017
public static < T > ObservableTransformer < T , T > doOnNextFx ( Consumer < T > onNext ) { return obs -> obs . doOnNext ( t -> runOnFx ( t , onNext ) ) ; }
Performs a given action for each item on the FX thread
4,018
public static < T > ObservableTransformer < T , T > doOnErrorCountFx ( Consumer < Integer > onError ) { return obs -> obs . compose ( doOnErrorCount ( i -> runOnFx ( i , onError ) ) ) ; }
Performs an action on FX thread on onError with the provided emission count
4,019
private static int checkResult ( int result ) { if ( exceptionsEnabled && result != cudaError . cudaSuccess ) { throw new CudaException ( cudaError . stringFor ( result ) ) ; } return result ; }
If the given result is different to cudaError . cudaSuccess and exceptions have been enabled this method will throw a CudaException with an error message that corresponds to the given result code . Otherwise the given result is simply returned .
4,020
public static int cudaMallocMipmappedArray ( cudaMipmappedArray mipmappedArray , cudaChannelFormatDesc desc , cudaExtent extent , int numLevels , int flags ) { return checkResult ( cudaMallocMipmappedArrayNative ( mipmappedArray , desc , extent , numLevels , flags ) ) ; }
Allocate a mipmapped array on the device .
4,021
public static int cudaArrayGetInfo ( cudaChannelFormatDesc desc , cudaExtent extent , int flags [ ] , cudaArray array ) { return checkResult ( cudaArrayGetInfoNative ( desc , extent , flags , array ) ) ; }
Gets info about the specified cudaArray .
4,022
public static int cudaHostAlloc ( Pointer ptr , long size , int flags ) { return checkResult ( cudaHostAllocNative ( ptr , size , flags ) ) ; }
Allocates page - locked memory on the host .
4,023
public static int cudaHostGetDevicePointer ( Pointer pDevice , Pointer pHost , int flags ) { return checkResult ( cudaHostGetDevicePointerNative ( pDevice , pHost , flags ) ) ; }
Passes back device pointer of mapped host memory allocated by cudaHostAlloc or registered by cudaHostRegister .
4,024
public static int cudaMallocPitch ( Pointer devPtr , long pitch [ ] , long width , long height ) { return checkResult ( cudaMallocPitchNative ( devPtr , pitch , width , height ) ) ; }
Allocates pitched memory on the device .
4,025
public static int cudaMemcpyPeer ( Pointer dst , int dstDevice , Pointer src , int srcDevice , long count ) { return checkResult ( cudaMemcpyPeerNative ( dst , dstDevice , src , srcDevice , count ) ) ; }
Copies memory between two devices .
4,026
public static int cudaMemcpyPeerAsync ( Pointer dst , int dstDevice , Pointer src , int srcDevice , long count , cudaStream_t stream ) { return checkResult ( cudaMemcpyPeerAsyncNative ( dst , dstDevice , src , srcDevice , count , stream ) ) ; }
Copies memory between two devices asynchronously .
4,027
public static int cudaEventElapsedTime ( float ms [ ] , cudaEvent_t start , cudaEvent_t end ) { return checkResult ( cudaEventElapsedTimeNative ( ms , start , end ) ) ; }
Computes the elapsed time between events .
4,028
public static int cudaConfigureCall ( dim3 gridDim , dim3 blockDim , long sharedMem , cudaStream_t stream ) { return checkResult ( cudaConfigureCallNative ( gridDim , blockDim , sharedMem , stream ) ) ; }
Configure a device - launch .
4,029
public static int cudaGLMapBufferObjectAsync ( Pointer devPtr , int bufObj , cudaStream_t stream ) { return checkResult ( cudaGLMapBufferObjectAsyncNative ( devPtr , bufObj , stream ) ) ; }
Maps a buffer object for access by CUDA .
4,030
public static int cudaGraphicsResourceGetMappedPointer ( Pointer devPtr , long size [ ] , cudaGraphicsResource resource ) { return checkResult ( cudaGraphicsResourceGetMappedPointerNative ( devPtr , size , resource ) ) ; }
Get an device pointer through which to access a mapped graphics resource .
4,031
public static int cudaProfilerInitialize ( String configFile , String outputFile , int outputMode ) { return checkResult ( cudaProfilerInitializeNative ( configFile , outputFile , outputMode ) ) ; }
Initialize the CUDA profiler .
4,032
private static int computePointerSize ( ) { String bits = System . getProperty ( "sun.arch.data.model" ) ; if ( bits . equals ( "32" ) ) { return 4 ; } else if ( bits . equals ( "64" ) ) { return 8 ; } else { System . err . println ( "Unknown value for sun.arch.data.model - assuming 32 bits" ) ; return 4 ; } }
Computes the size of a pointer in bytes
4,033
public static String stringFor ( int n ) { if ( n == 0 ) { return "CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE" ; } String result = "" ; if ( ( n & CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY ) != 0 ) result += "CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY " ; if ( ( n & CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD ) != 0 ) result +=...
Returns the String identifying the given CUgraphicsMapResourceFlags
4,034
public static String stringFor ( int n ) { if ( n == 0 ) { return "CU_STREAM_WAIT_VALUE_GEQ" ; } String result = "" ; if ( ( n & CU_STREAM_WAIT_VALUE_EQ ) != 0 ) result += "CU_STREAM_WAIT_VALUE_EQ " ; if ( ( n & CU_STREAM_WAIT_VALUE_AND ) != 0 ) result += "CU_STREAM_WAIT_VALUE_AND " ; if ( ( n & CU_STREAM_WAIT_VALUE_NO...
Returns the String identifying the given CUstreamWaitValue_flags
4,035
public static String stringFor ( int n ) { switch ( n ) { case CU_RES_VIEW_FORMAT_NONE : return "CU_RES_VIEW_FORMAT_NONE" ; case CU_RES_VIEW_FORMAT_UINT_1X8 : return "CU_RES_VIEW_FORMAT_UINT_1X8" ; case CU_RES_VIEW_FORMAT_UINT_2X8 : return "CU_RES_VIEW_FORMAT_UINT_2X8" ; case CU_RES_VIEW_FORMAT_UINT_4X8 : return "CU_RE...
Returns the String identifying the given CUresourceViewFormat
4,036
public static String stringFor ( int n ) { switch ( n ) { case CU_JIT_MAX_REGISTERS : return "CU_JIT_MAX_REGISTERS" ; case CU_JIT_THREADS_PER_BLOCK : return "CU_JIT_THREADS_PER_BLOCK" ; case CU_JIT_WALL_TIME : return "CU_JIT_WALL_TIME" ; case CU_JIT_INFO_LOG_BUFFER : return "CU_JIT_INFO_LOG_BUFFER" ; case CU_JIT_INFO_L...
Returns the String identifying the given CUjit_option
4,037
private static int checkResult ( int result ) { if ( exceptionsEnabled && result != nvrtcResult . NVRTC_SUCCESS ) { throw new CudaException ( nvrtcResult . stringFor ( result ) ) ; } return result ; }
If the given result is different to nvrtcResult . NVRTC_SUCCESS and exceptions have been enabled this method will throw a CudaException with an error message that corresponds to the given result code . Otherwise the given result is simply returned .
4,038
public void setName ( String nameString ) { byte bytes [ ] = nameString . getBytes ( ) ; int n = Math . min ( name . length , bytes . length ) ; System . arraycopy ( bytes , 0 , name , 0 , n ) ; }
Set the name of this cudaDeviceProp to the given name
4,039
private static String createString ( byte bytes [ ] ) { StringBuilder sb = new StringBuilder ( ) ; if ( bytes == null ) { sb . append ( "null" ) ; } else { for ( byte b : bytes ) { if ( Character . isLetterOrDigit ( b ) || Character . isWhitespace ( b ) ) { sb . append ( ( char ) b ) ; } } } return sb . toString ( ) ; ...
Creates a String from the letter digit and whitespace characters in the given byte array
4,040
private static String createByteString ( byte bytes [ ] ) { StringBuilder sb = new StringBuilder ( ) ; if ( bytes == null ) { sb . append ( "null" ) ; } else { for ( byte b : bytes ) { sb . append ( String . format ( "%02x" , b ) ) ; } } return sb . toString ( ) ; }
Creates a String containing the hex representation of the given bytes
4,041
public static String stringFor ( int m ) { switch ( m ) { case cudaResViewFormatNone : return "cudaResViewFormatNone" ; case cudaResViewFormatUnsignedChar1 : return "cudaResViewFormatUnsignedChar1" ; case cudaResViewFormatUnsignedChar2 : return "cudaResViewFormatUnsignedChar2" ; case cudaResViewFormatUnsignedChar4 : re...
Returns the String identifying the given cudaResourceViewFormat
4,042
public static String stringFor ( int n ) { switch ( n ) { case CUDA_R_16F : return "CUDA_R_16F" ; case CUDA_C_16F : return "CUDA_C_16F" ; case CUDA_R_32F : return "CUDA_R_32F" ; case CUDA_C_32F : return "CUDA_C_32F" ; case CUDA_R_64F : return "CUDA_R_64F" ; case CUDA_C_64F : return "CUDA_C_64F" ; case CUDA_R_8I : retur...
Returns the String identifying the given cudaDataType
4,043
public static String stringFor ( int n ) { if ( n == 0 ) { return "CU_STREAM_WRITE_VALUE_DEFAULT" ; } String result = "" ; if ( ( n & CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER ) != 0 ) result += "CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER " ; return result ; }
Returns the String identifying the given CUstreamWriteValue_flags
4,044
int [ ] getKeys ( ) { Set < Integer > keySet = map . keySet ( ) ; int keys [ ] = new int [ keySet . size ( ) ] ; int index = 0 ; for ( Integer key : keySet ) { keys [ index ] = key ; index ++ ; } return keys ; }
Package private method to obtain the keys stored in these options . Also used on native side .
4,045
public static String stringFor ( int result ) { switch ( result ) { case NVRTC_SUCCESS : return "NVRTC_SUCCESS" ; case NVRTC_ERROR_OUT_OF_MEMORY : return "NVRTC_ERROR_OUT_OF_MEMORY" ; case NVRTC_ERROR_PROGRAM_CREATION_FAILURE : return "NVRTC_ERROR_PROGRAM_CREATION_FAILURE" ; case NVRTC_ERROR_INVALID_INPUT : return "NVR...
Returns the String identifying the given nvrtcResult
4,046
public static String stringFor ( int n ) { switch ( n ) { case CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK : return "CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK" ; case CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES : return "CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES" ; case CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES : return "CU_FUNC_ATTRIBUTE_CONST_...
Returns the String identifying the given CUfunction_attribute
4,047
public static String stringFor ( int k ) { switch ( k ) { case cudaMemcpyHostToHost : return "cudaMemcpyHostToHost" ; case cudaMemcpyHostToDevice : return "cudaMemcpyHostToDevice" ; case cudaMemcpyDeviceToHost : return "cudaMemcpyDeviceToHost" ; case cudaMemcpyDeviceToDevice : return "cudaMemcpyDeviceToDevice" ; case c...
Returns the String identifying the given cudaMemcpyKind
4,048
public static String stringFor ( int n ) { switch ( n ) { case cudaGraphicsRegisterFlagsNone : return "cudaGraphicsRegisterFlagsNone" ; case cudaGraphicsRegisterFlagsReadOnly : return "cudaGraphicsRegisterFlagsReadOnly" ; case cudaGraphicsRegisterFlagsWriteDiscard : return "cudaGraphicsRegisterFlagsWriteDiscard" ; case...
Returns the String identifying the given cudaGraphicsRegisterFlags
4,049
public static String stringFor ( int n ) { switch ( n ) { case CU_POINTER_ATTRIBUTE_CONTEXT : return "CU_POINTER_ATTRIBUTE_CONTEXT" ; case CU_POINTER_ATTRIBUTE_MEMORY_TYPE : return "CU_POINTER_ATTRIBUTE_MEMORY_TYPE" ; case CU_POINTER_ATTRIBUTE_DEVICE_POINTER : return "CU_POINTER_ATTRIBUTE_DEVICE_POINTER" ; case CU_POIN...
Returns the String identifying the given CUpointer_attribute
4,050
public static String stringFor ( int n ) { switch ( n ) { case CU_CUBEMAP_FACE_POSITIVE_X : return "CU_CUBEMAP_FACE_POSITIVE_X" ; case CU_CUBEMAP_FACE_NEGATIVE_X : return "CU_CUBEMAP_FACE_NEGATIVE_X" ; case CU_CUBEMAP_FACE_POSITIVE_Y : return "CU_CUBEMAP_FACE_POSITIVE_Y" ; case CU_CUBEMAP_FACE_NEGATIVE_Y : return "CU_C...
Returns the String identifying the given CUarray_cubemap_face
4,051
public static String stringFor ( int n ) { if ( n == 0 ) { return "CU_STREAM_DEFAULT" ; } String result = "" ; if ( ( n & CU_STREAM_NON_BLOCKING ) != 0 ) result += "CU_STREAM_NON_BLOCKING " ; return result ; }
Returns the String identifying the given CUstream_flags
4,052
public static String stringFor ( int n ) { switch ( n ) { case CU_TARGET_COMPUTE_10 : return "CU_TARGET_COMPUTE_10" ; case CU_TARGET_COMPUTE_11 : return "CU_TARGET_COMPUTE_11" ; case CU_TARGET_COMPUTE_12 : return "CU_TARGET_COMPUTE_12" ; case CU_TARGET_COMPUTE_13 : return "CU_TARGET_COMPUTE_13" ; case CU_TARGET_COMPUTE...
Returns the String identifying the given CUjit_target
4,053
private static void loadLibraryResource ( String resourceSubdirectoryName , String libraryName , String tempSubdirectoryName , String ... dependentLibraryNames ) throws Throwable { for ( String dependentLibraryName : dependentLibraryNames ) { logger . log ( level , "Library " + libraryName + " depends on " + dependentL...
Load the library with the given name from a resource .
4,054
private static File createTempFile ( String tempSubdirectoryName , String name ) throws IOException { String tempDirName = System . getProperty ( "java.io.tmpdir" ) ; File tempSubDirectory = new File ( tempDirName + File . separator + tempSubdirectoryName ) ; if ( ! tempSubDirectory . exists ( ) ) { boolean createdDire...
Create a file object representing the file with the given name in the specified subdirectory of the default temp directory . If the specified subdirectory does not exist yet it is created .
4,055
public static OSType calculateOS ( ) { String vendor = System . getProperty ( "java.vendor" ) ; if ( "The Android Project" . equals ( vendor ) ) { return OSType . ANDROID ; } String osName = System . getProperty ( "os.name" ) ; osName = osName . toLowerCase ( Locale . ENGLISH ) ; if ( osName . startsWith ( "mac os" ) )...
Calculates the current OSType
4,056
public static ArchType calculateArch ( ) { String osArch = System . getProperty ( "os.arch" ) ; osArch = osArch . toLowerCase ( Locale . ENGLISH ) ; if ( "i386" . equals ( osArch ) || "x86" . equals ( osArch ) || "i686" . equals ( osArch ) ) { return ArchType . X86 ; } if ( osArch . startsWith ( "amd64" ) || osArch . s...
Calculates the current ARCHType
4,057
public static String stringFor ( int n ) { switch ( n ) { case CU_GRAPH_NODE_TYPE_KERNEL : return "CU_GRAPH_NODE_TYPE_KERNEL" ; case CU_GRAPH_NODE_TYPE_MEMCPY : return "CU_GRAPH_NODE_TYPE_MEMCPY" ; case CU_GRAPH_NODE_TYPE_MEMSET : return "CU_GRAPH_NODE_TYPE_MEMSET" ; case CU_GRAPH_NODE_TYPE_HOST : return "CU_GRAPH_NODE...
Returns the String identifying the given CUgraphNodeType
4,058
public static String stringFor ( int result ) { switch ( result ) { case CUDA_SUCCESS : return "CUDA_SUCCESS" ; case CUDA_ERROR_INVALID_VALUE : return "CUDA_ERROR_INVALID_VALUE" ; case CUDA_ERROR_OUT_OF_MEMORY : return "CUDA_ERROR_OUT_OF_MEMORY" ; case CUDA_ERROR_NOT_INITIALIZED : return "CUDA_ERROR_NOT_INITIALIZED" ; ...
Returns the String identifying the given CUresult
4,059
public static String stringFor ( int n ) { switch ( n ) { case cudaGraphicsCubeFacePositiveX : return "cudaGraphicsCubeFacePositiveX" ; case cudaGraphicsCubeFaceNegativeX : return "cudaGraphicsCubeFaceNegativeX" ; case cudaGraphicsCubeFacePositiveY : return "cudaGraphicsCubeFacePositiveY" ; case cudaGraphicsCubeFaceNeg...
Returns the String identifying the given cudaGraphicsCubeFace
4,060
public static String stringFor ( int n ) { if ( n == 0 ) { return "CU_GRAPHICS_REGISTER_FLAGS_NONE" ; } String result = "" ; if ( ( n & CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY ) != 0 ) result += "CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY " ; if ( ( n & CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD ) != 0 ) result += "CU_GRAPHICS_RE...
Returns the String identifying the given CUgraphicsRegisterFlags
4,061
public static String stringFor ( int n ) { switch ( n ) { case CU_AD_FORMAT_UNSIGNED_INT8 : return "CU_AD_FORMAT_UNSIGNED_INT8" ; case CU_AD_FORMAT_UNSIGNED_INT16 : return "CU_AD_FORMAT_UNSIGNED_INT16" ; case CU_AD_FORMAT_UNSIGNED_INT32 : return "CU_AD_FORMAT_UNSIGNED_INT32" ; case CU_AD_FORMAT_SIGNED_INT8 : return "CU...
Returns the String identifying the given CUarray_format
4,062
public static String stringFor ( int n ) { if ( n == 0 ) { return "INVALID CUipcMem_flags: " + n ; } String result = "" ; if ( ( n & CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS ) != 0 ) result += "CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS" ; return result ; }
Returns the String identifying the given CUipcMem_flags
4,063
public static String stringFor ( int n ) { if ( n == 0 ) { return "INVALID CUmemAttach_flags: " + n ; } String result = "" ; if ( ( n & CU_MEM_ATTACH_GLOBAL ) != 0 ) result += "CU_MEM_ATTACH_GLOBAL " ; if ( ( n & CU_MEM_ATTACH_HOST ) != 0 ) result += "CU_MEM_ATTACH_HOST " ; if ( ( n & CU_MEM_ATTACH_SINGLE ) != 0 ) resu...
Returns the String identifying the given CUmemAttach_flags
4,064
public static String stringFor ( int n ) { switch ( n ) { case CU_CTX_SCHED_AUTO : return "CU_CTX_SCHED_AUTO" ; case CU_CTX_SCHED_SPIN : return "CU_CTX_SCHED_SPIN" ; case CU_CTX_SCHED_YIELD : return "CU_CTX_SCHED_YIELD" ; case CU_CTX_BLOCKING_SYNC : return "CU_CTX_BLOCKING_SYNC" ; case CU_CTX_MAP_HOST : return "CU_CTX_...
Returns the String identifying the given CUctx_flags
4,065
public static String stringFor ( int n ) { if ( n == 0 ) { return "CU_GL_MAP_RESOURCE_FLAGS_NONE" ; } String result = "" ; if ( ( n & CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY ) != 0 ) result += "CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY " ; if ( ( n & CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD ) != 0 ) result += "CU_GL_MAP_RESOURCE_FLA...
Returns the String identifying the given CUGLmap_flags
4,066
public static String stringFor ( int n ) { switch ( n ) { case cudaLimitStackSize : return "cudaLimitStackSize" ; case cudaLimitPrintfFifoSize : return "cudaLimitPrintfFifoSize" ; case cudaLimitMallocHeapSize : return "cudaLimitMallocHeapSize" ; case cudaLimitDevRuntimeSyncDepth : return "cudaLimitDevRuntimeSyncDepth" ...
Returns the String identifying the given cudaLimit
4,067
public static String stringFor ( int n ) { switch ( n ) { case CU_LIMIT_STACK_SIZE : return "CU_LIMIT_STACK_SIZE" ; case CU_LIMIT_PRINTF_FIFO_SIZE : return "CU_LIMIT_PRINTF_FIFO_SIZE" ; case CU_LIMIT_MALLOC_HEAP_SIZE : return "CU_LIMIT_MALLOC_HEAP_SIZE" ; case CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH : return "CU_LIMIT_DEV_RUNT...
Returns the String identifying the given CUlimit
4,068
public static String stringFor ( int n ) { switch ( n ) { case CU_MEM_ADVISE_SET_READ_MOSTLY : return "CU_MEM_ADVISE_SET_READ_MOSTLY" ; case CU_MEM_ADVISE_UNSET_READ_MOSTLY : return "CU_MEM_ADVISE_UNSET_READ_MOSTLY" ; case CU_MEM_ADVISE_SET_PREFERRED_LOCATION : return "CU_MEM_ADVISE_SET_PREFERRED_LOCATION" ; case CU_ME...
Returns the String identifying the given CUmem_advise
4,069
public static String stringFor ( int n ) { if ( n == 0 ) { return "CU_EVENT_DEFAULT" ; } String result = "" ; if ( ( n & CU_EVENT_BLOCKING_SYNC ) != 0 ) result += "CU_EVENT_BLOCKING_SYNC " ; if ( ( n & CU_EVENT_DISABLE_TIMING ) != 0 ) result += "CU_EVENT_DISABLE_TIMING " ; if ( ( n & CU_EVENT_INTERPROCESS ) != 0 ) resu...
Returns the String identifying the given CUevent_flags
4,070
public static String stringFor ( int n ) { switch ( n ) { case CU_JIT_INPUT_CUBIN : return "CU_JIT_INPUT_CUBIN" ; case CU_JIT_INPUT_PTX : return "CU_JIT_INPUT_PTX" ; case CU_JIT_INPUT_FATBINARY : return "CU_JIT_INPUT_FATBINARY" ; case CU_JIT_INPUT_OBJECT : return "CU_JIT_INPUT_OBJECT" ; case CU_JIT_INPUT_LIBRARY : retu...
Returns the String identifying the given CUjitInputType
4,071
public static String stringFor ( int k ) { switch ( k ) { case cudaMemAdviseSetReadMostly : return "cudaMemAdviseSetReadMostly" ; case cudaMemAdviseUnsetReadMostly : return "cudaMemAdviseUnsetReadMostly" ; case cudaMemAdviseSetPreferredLocation : return "cudaMemAdviseSetPreferredLocation" ; case cudaMemAdviseUnsetPrefe...
Returns the String identifying the given cudaMemoryAdvise
4,072
private static int checkResult ( int result ) { if ( exceptionsEnabled && result != CUresult . CUDA_SUCCESS ) { throw new CudaException ( CUresult . stringFor ( result ) ) ; } return result ; }
If the given result is different to CUresult . CUDA_SUCCESS and exceptions have been enabled this method will throw a CudaException with an error message that corresponds to the given result code . Otherwise the given result is simply returned .
4,073
public static int cuDeviceGetName ( byte name [ ] , int len , CUdevice dev ) { return checkResult ( cuDeviceGetNameNative ( name , len , dev ) ) ; }
Returns an identifer string for the device .
4,074
public static int cuDeviceGetLuid ( byte luid [ ] , int deviceNodeMask [ ] , CUdevice dev ) { return checkResult ( cuDeviceGetLuidNative ( luid , deviceNodeMask , dev ) ) ; }
Return an LUID and device node mask for the device .
4,075
public static int cuDeviceComputeCapability ( int major [ ] , int minor [ ] , CUdevice dev ) { return checkResult ( cuDeviceComputeCapabilityNative ( major , minor , dev ) ) ; }
Returns the compute capability of the device .
4,076
public static int cuDeviceGetProperties ( CUdevprop prop , CUdevice dev ) { return checkResult ( cuDeviceGetPropertiesNative ( prop , dev ) ) ; }
Returns properties for a selected device .
4,077
public static int cuDeviceGetAttribute ( int pi [ ] , int attrib , CUdevice dev ) { return checkResult ( cuDeviceGetAttributeNative ( pi , attrib , dev ) ) ; }
Returns information about the device .
4,078
public static int cuCtxCreate ( CUcontext pctx , int flags , CUdevice dev ) { return checkResult ( cuCtxCreateNative ( pctx , flags , dev ) ) ; }
Create a CUDA context .
4,079
public static int cuModuleGetFunction ( CUfunction hfunc , CUmodule hmod , String name ) { return checkResult ( cuModuleGetFunctionNative ( hfunc , hmod , name ) ) ; }
Returns a function handle .
4,080
public static int cuModuleGetGlobal ( CUdeviceptr dptr , long bytes [ ] , CUmodule hmod , String name ) { return checkResult ( cuModuleGetGlobalNative ( dptr , bytes , hmod , name ) ) ; }
Returns a global pointer from a module .
4,081
public static int cuModuleGetTexRef ( CUtexref pTexRef , CUmodule hmod , String name ) { return checkResult ( cuModuleGetTexRefNative ( pTexRef , hmod , name ) ) ; }
Returns a handle to a texture reference .
4,082
public static int cuModuleGetSurfRef ( CUsurfref pSurfRef , CUmodule hmod , String name ) { return checkResult ( cuModuleGetSurfRefNative ( pSurfRef , hmod , name ) ) ; }
Returns a handle to a surface reference .
4,083
public static int cuMemHostAlloc ( Pointer pp , long bytes , int Flags ) { return checkResult ( cuMemHostAllocNative ( pp , bytes , Flags ) ) ; }
Allocates page - locked host memory .
4,084
public static int cuMemHostGetDevicePointer ( CUdeviceptr ret , Pointer p , int Flags ) { return checkResult ( cuMemHostGetDevicePointerNative ( ret , p , Flags ) ) ; }
Passes back device pointer of mapped pinned memory .
4,085
public static int cuMemcpy ( CUdeviceptr dst , CUdeviceptr src , long ByteCount ) { return checkResult ( cuMemcpyNative ( dst , src , ByteCount ) ) ; }
Copies memory .
4,086
public static int cuMemcpyPeer ( CUdeviceptr dstDevice , CUcontext dstContext , CUdeviceptr srcDevice , CUcontext srcContext , long ByteCount ) { return cuMemcpyPeerNative ( dstDevice , dstContext , srcDevice , srcContext , ByteCount ) ; }
Copies device memory between two contexts .
4,087
public static int cuMemAllocPitch ( CUdeviceptr dptr , long pPitch [ ] , long WidthInBytes , long Height , int ElementSizeBytes ) { return checkResult ( cuMemAllocPitchNative ( dptr , pPitch , WidthInBytes , Height , ElementSizeBytes ) ) ; }
Allocates pitched device memory .
4,088
public static int cuMemGetAddressRange ( CUdeviceptr pbase , long psize [ ] , CUdeviceptr dptr ) { return checkResult ( cuMemGetAddressRangeNative ( pbase , psize , dptr ) ) ; }
Get information on memory allocations .
4,089
public static int cuMemcpyDtoA ( CUarray dstArray , long dstIndex , CUdeviceptr srcDevice , long ByteCount ) { return checkResult ( cuMemcpyDtoANative ( dstArray , dstIndex , srcDevice , ByteCount ) ) ; }
Copies memory from Device to Array .
4,090
public static int cuMemcpyAtoD ( CUdeviceptr dstDevice , CUarray hSrc , long SrcIndex , long ByteCount ) { return checkResult ( cuMemcpyAtoDNative ( dstDevice , hSrc , SrcIndex , ByteCount ) ) ; }
Copies memory from Array to Device .
4,091
public static int cuMemcpyAtoA ( CUarray dstArray , long dstIndex , CUarray srcArray , long srcIndex , long ByteCount ) { return checkResult ( cuMemcpyAtoANative ( dstArray , dstIndex , srcArray , srcIndex , ByteCount ) ) ; }
Copies memory from Array to Array .
4,092
public static int cuMemcpyAsync ( CUdeviceptr dst , CUdeviceptr src , long ByteCount , CUstream hStream ) { return checkResult ( cuMemcpyAsyncNative ( dst , src , ByteCount , hStream ) ) ; }
Copies memory asynchronously .
4,093
public static int cuMemcpyPeerAsync ( CUdeviceptr dstDevice , CUcontext dstContext , CUdeviceptr srcDevice , CUcontext srcContext , long ByteCount , CUstream hStream ) { return checkResult ( cuMemcpyPeerAsyncNative ( dstDevice , dstContext , srcDevice , srcContext , ByteCount , hStream ) ) ; }
Copies device memory between two contexts asynchronously .
4,094
public static int cuFuncGetAttribute ( int pi [ ] , int attrib , CUfunction func ) { return checkResult ( cuFuncGetAttributeNative ( pi , attrib , func ) ) ; }
Returns information about a function .
4,095
public static int cuFuncSetBlockShape ( CUfunction hfunc , int x , int y , int z ) { return checkResult ( cuFuncSetBlockShapeNative ( hfunc , x , y , z ) ) ; }
Sets the block - dimensions for the function .
4,096
public static int cuMipmappedArrayCreate ( CUmipmappedArray pHandle , CUDA_ARRAY3D_DESCRIPTOR pMipmappedArrayDesc , int numMipmapLevels ) { return checkResult ( cuMipmappedArrayCreateNative ( pHandle , pMipmappedArrayDesc , numMipmapLevels ) ) ; }
Creates a CUDA mipmapped array .
4,097
public static int cuTexRefSetArray ( CUtexref hTexRef , CUarray hArray , int Flags ) { return checkResult ( cuTexRefSetArrayNative ( hTexRef , hArray , Flags ) ) ; }
Binds an array as a texture reference .
4,098
public static int cuTexRefSetMipmappedArray ( CUtexref hTexRef , CUmipmappedArray hMipmappedArray , int Flags ) { return checkResult ( cuTexRefSetMipmappedArrayNative ( hTexRef , hMipmappedArray , Flags ) ) ; }
Binds a mipmapped array to a texture reference .
4,099
public static int cuTexRefSetAddress ( long ByteOffset [ ] , CUtexref hTexRef , CUdeviceptr dptr , long bytes ) { return checkResult ( cuTexRefSetAddressNative ( ByteOffset , hTexRef , dptr , bytes ) ) ; }
Binds an address as a texture reference .