code
stringlengths
73
34.1k
label
stringclasses
1 value
public void putBytes(byte[] b, int boff, int len) { System.arraycopy(b, boff, _buffer, _offset, len); skip(len); }
java
public void putPayloads(List<ByteBuffer> payloads, int size) { putInt(size); if (_payloads == null) { _payloads = payloads; } else { _payloads.addAll(payloads); } _payloadsSize += size; }
java
protected void connect() throws RpcException { if (_state.equals(State.CONNECTED)) { return; } final ChannelFuture oldChannelFuture = _channelFuture; if (LOG.isDebugEnabled()) { String logPrefix = _usePrivilegedPort ? "usePrivilegedPort " : ""; LOG.d...
java
protected void close() { _state = State.DISCONNECTED; shutdown(); // remove the connection from map NetMgr.getInstance().dropConnection(InetSocketAddress.createUnresolved(_remoteHost, _port)); // notify all the pending requests in the timeout map notifyAllPendingSender...
java
protected void notifySender(Integer xid, Xdr response) { ChannelFuture future = _futureMap.get(xid); if (future != null) { _responseMap.put(xid, response); future.setSuccess(); } }
java
protected void notifyAllPendingSenders(String message) { for (ChannelFuture future : _futureMap.values()) { future.setFailure(new Error(message)); } }
java
private Channel bindToPrivilegedPort() throws RpcException { System.out.println("Attempting to use privileged port."); for (int port = 1023; port > 0; --port) { try { ChannelPipeline pipeline = _clientBootstrap.getPipelineFactory().getPipeline(); Channel chann...
java
protected List<F> getChildFiles(List<String> childNames) throws IOException { if (childNames == null) { return null; } List<F> childFiles = new ArrayList<F>(childNames.size()); for (String childName : childNames) { childFiles.add(getChildFile(childName)); ...
java
private void setParentFileAndName(F parentFile, String name, LinkTracker<N, F> linkTracker) throws IOException { if (parentFile != null) { parentFile = parentFile.followLinks(linkTracker); if (StringUtils.isBlank(name) || ".".equals(name)) { name = parentFile.getName(); ...
java
private void setFileHandle() { byte[] fileHandle = null; if (_isRootFile) { fileHandle = getNfs().getRootFileHandle(); } else { try { if (getParentFile().getFileHandle() != null) { fileHandle = getNfs().wrapped_getLookup(makeLookupReque...
java
public void callRpcWrapped(S request, RpcResponseHandler<? extends T> responseHandler) throws IOException { for (int i = 0; i < _maximumRetries; ++i) { try { callRpcChecked(request, responseHandler); return; } catch (RpcException e) { handl...
java
public void callRpcNaked(S request, T response) throws IOException { callRpcNaked(request, response, chooseIP(request.getIpKey())); }
java
public void callRpcNaked(S request, T response, String ipAddress) throws RpcException { Xdr xdr = new Xdr(_maximumRequestSize); request.marshalling(xdr); response.unmarshalling(callRpc(ipAddress, xdr, request.isUsePrivilegedPort())); }
java
public Xdr callRpc(String serverIP, Xdr xdrRequest, boolean usePrivilegedPort) throws RpcException { return NetMgr.getInstance().sendAndWait(serverIP, _port, usePrivilegedPort, xdrRequest, _rpcTimeout); }
java
private void callRpcChecked(S request, RpcResponseHandler<? extends T> responseHandler, String ipAddress) throws IOException { LOG.debug("server {}, port {}, request {}", _server, _port, request); callRpcNaked(request, responseHandler.getNewResponse(), ipAddress); if (LOG.isDebugEn...
java
private void handleRpcException(RpcException e, int attemptNumber) throws IOException { String messageStart; if (!(e.getStatus().equals(RpcStatus.NETWORK_ERROR))) { messageStart = "rpc"; } else { // check whether to retry if (attemptNumber + 1 < _maximumRetri...
java
private String[] probeIps() { Set<String> ips = new TreeSet<String>(); for (int i = 0; i < 32; ++i) { InetSocketAddress sa = new InetSocketAddress(_server, _port); ips.add(sa.getAddress().getHostAddress()); } if (LOG.isDebugEnabled()) { StringBuffer s...
java
public Xdr sendAndWait(String serverIP, int port, boolean usePrivilegedPort, Xdr xdrRequest, int timeout) throws RpcException { InetSocketAddress key = InetSocketAddress.createUnresolved(serverIP, port); Map<InetSocketAddress, Connection> connectionMap = usePrivilegedPort ? _privilegedConnectionMap : _...
java
public void shutdown() { for (Connection connection : _connectionMap.values()) { connection.shutdown(); } for (Connection connection : _privilegedConnectionMap.values()) { connection.shutdown(); } _factory.releaseExternalResources(); }
java
private void loadBytesAsNeeded() throws IOException { if (available() <= 0) { _isEof = true; } while ((!_isEof) && (bytesLeftInBuffer() <= 0)) { _currentBufferPosition = 0; NfsReadResponse response = _file.read(_offset, _bytes.length, _bytes, _currentBufferPo...
java
private void checkForBlank(String value, String name) { if (StringUtils.isBlank(value)) { throw new IllegalArgumentException(name + " cannot be empty"); } }
java
private void prepareRootFhAndNfsPort() throws IOException { if (!_prepareLock.tryLock()) { return; } try { _port = getNfsPortFromServer(); _rpcWrapper.setPort(_port); _rootFileHandle = lookupRootHandle(); } finally { _prepareL...
java
private boolean handleRpcException(RpcException e, int attemptNumber) throws IOException { boolean tryPrivilegedPort = e.getStatus().equals(RejectStatus.AUTH_ERROR); boolean networkError = e.getStatus().equals(RpcStatus.NETWORK_ERROR); boolean retry = (tryPrivilegedPort || networkErr...
java
public int read(String path, byte[] fileHandle, long offset, int length, final byte[] data, final int pos, final MutableBoolean eof) throws IOException { Nfs3ReadRequest request = new Nfs3ReadRequest(fileHandle, offset, length, _credential); NfsResponseHandler<Nfs3ReadResponse> responseHandler = n...
java
synchronized final F addLink(String path) throws IOException { if (++linksTraversed > MAXSYMLINKS) { throw new IllegalArgumentException("Too many links to follow (> " + MAXSYMLINKS + ")."); } F resolvedPath = _resolvedPaths.get(path); if (resolvedPath == null) { ...
java
synchronized void addResolvedPath(String path, F file) { _resolvedPaths.put(path, file); _unresolvedPaths.remove(path); }
java
public static NfsType fromValue(int value) { NfsType nfsType = VALUES.get(value); if (nfsType == null) { nfsType = new NfsType(value); VALUES.put(value, nfsType); } return nfsType; }
java
private static boolean isMappingExist(RestHighLevelClient client, String index) throws Exception { GetMappingsResponse mapping = client.indices().getMapping(new GetMappingsRequest().indices(index), RequestOptions.DEFAULT); // Let's get the default mapping if (mapping.mappings().isEmpty()) { ...
java
public static List<String> findTypes(String index) throws IOException, URISyntaxException { return findTypes(Defaults.ConfigDir, index); }
java
private void initAliases() throws Exception { if (aliases != null && aliases.length > 0) { for (String aliasIndex : aliases) { Tuple<String, String> aliasIndexSplitted = computeAlias(aliasIndex); createAlias(client.getLowLevelClient(), aliasIndexSplitted.v2(), aliasIndexSplitted.v1()); } }...
java
static BeanDefinitionBuilder startClientBuilder(Class beanClass, String properties, boolean forceMapping, boolean forceTemplate, boolean mergeMapping, boolean mergeSettings, ...
java
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(re...
java
private void selectImage() { // Start picker activity // For simplicity we're loading credentials from a string res, don't do this in production String apiKey = getString(R.string.filestack_api_key); if (apiKey.equals("")) { throw new RuntimeException("Create a string res va...
java
private void createAccount() { // TODO Validate form data and send off request String name = nameView.getText().toString(); ((MainActivity) getActivity()).setComplete(name); }
java
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(); }
java
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 + "_"; // Store in normal camera directory ...
java
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);...
java
public static void initializeClient(Config config, String sessionToken) { // Override returnUrl until introduction of FilestackUi class which will allow to set this // all up manually. Config overridenConfig = new Config(config.getApiKey(), "filestack://done", config.getPolicy(),...
java
public static boolean mimeAllowed(String[] filters, String mimeType) { return MimeTypeFilter.matches(mimeType, filters) != null; }
java
public void setLoading(boolean isLoading) { getSupportFragmentManager() .beginTransaction() .replace(R.id.root, isLoading ? loadingFragment : formFragment) .commit(); }
java
public void setComplete(String name) { CompleteFragment fragment = CompleteFragment.create(name); getSupportFragmentManager() .beginTransaction() .replace(R.id.root, fragment) .commit(); }
java
public void reset() { fileLink = null; formFragment = new FormFragment(); getSupportFragmentManager() .beginTransaction() .replace(R.id.root, formFragment) .commit(); }
java
void saveState(Bundle outState) { outState.putString(STATE_CURRENT_PATH, currentPath); outState.putSerializable(STATE_FOLDERS, folders); outState.putSerializable(STATE_NEXT_TOKENS, nextTokens); }
java
public boolean hasSubscriptions() { return !disposedInd && ((bindings != null && !bindings.isEmpty()) || (compBindings != null && !compBindings.isEmpty())); }
java
public static <T> FlowableTransformer<T,T> doOnErrorFx(Consumer<Throwable> onError) { return obs -> obs.doOnError(e -> runOnFx(e,onError)); }
java
public static <T> FlowableTransformer<T,T> doOnNextCountFx(Consumer<Integer> onNext) { return obs -> obs.compose(doOnNextCount(i -> runOnFx(i,onNext))); }
java
public static <T> FlowableTransformer<T,T> doOnCompleteCountFx(Consumer<Integer> onComplete) { return obs -> obs.compose(doOnCompleteCount(i -> runOnFx(i,onComplete))); }
java
public static <T> ObservableTransformer<T,T> doOnNextFx(Consumer<T> onNext) { return obs -> obs.doOnNext(t -> runOnFx(t, onNext)); }
java
public static <T> ObservableTransformer<T,T> doOnErrorCountFx(Consumer<Integer> onError) { return obs -> obs.compose(doOnErrorCount(i -> runOnFx(i,onError))); }
java
private static int checkResult(int result) { if (exceptionsEnabled && result != cudaError.cudaSuccess) { throw new CudaException(cudaError.stringFor(result)); } return result; }
java
public static int cudaMallocMipmappedArray(cudaMipmappedArray mipmappedArray, cudaChannelFormatDesc desc, cudaExtent extent, int numLevels, int flags) { return checkResult(cudaMallocMipmappedArrayNative(mipmappedArray, desc, extent, numLevels, flags)); }
java
public static int cudaArrayGetInfo(cudaChannelFormatDesc desc, cudaExtent extent, int flags[], cudaArray array) { return checkResult(cudaArrayGetInfoNative(desc, extent, flags, array)); }
java
public static int cudaHostAlloc(Pointer ptr, long size, int flags) { return checkResult(cudaHostAllocNative(ptr, size, flags)); }
java
public static int cudaHostGetDevicePointer(Pointer pDevice, Pointer pHost, int flags) { return checkResult(cudaHostGetDevicePointerNative(pDevice, pHost, flags)); }
java
public static int cudaMallocPitch(Pointer devPtr, long pitch[], long width, long height) { return checkResult(cudaMallocPitchNative(devPtr, pitch, width, height)); }
java
public static int cudaMemcpyPeer(Pointer dst, int dstDevice, Pointer src, int srcDevice, long count) { return checkResult(cudaMemcpyPeerNative(dst, dstDevice, src, srcDevice, count)); }
java
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)); }
java
public static int cudaEventElapsedTime(float ms[], cudaEvent_t start, cudaEvent_t end) { return checkResult(cudaEventElapsedTimeNative(ms, start, end)); }
java
@Deprecated public static int cudaConfigureCall(dim3 gridDim, dim3 blockDim, long sharedMem, cudaStream_t stream) { return checkResult(cudaConfigureCallNative(gridDim, blockDim, sharedMem, stream)); }
java
@Deprecated public static int cudaGLMapBufferObjectAsync(Pointer devPtr, int bufObj, cudaStream_t stream) { return checkResult(cudaGLMapBufferObjectAsyncNative(devPtr, bufObj, stream)); }
java
public static int cudaGraphicsResourceGetMappedPointer(Pointer devPtr, long size[], cudaGraphicsResource resource) { return checkResult(cudaGraphicsResourceGetMappedPointerNative(devPtr, size, resource)); }
java
public static int cudaProfilerInitialize(String configFile, String outputFile, int outputMode) { return checkResult(cudaProfilerInitializeNative(configFile, outputFile, outputMode)); }
java
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...
java
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 & C...
java
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_STRE...
java
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_V...
java
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_L...
java
private static int checkResult(int result) { if (exceptionsEnabled && result != nvrtcResult.NVRTC_SUCCESS) { throw new CudaException(nvrtcResult.stringFor(result)); } return result; }
java
public void setName(String nameString) { byte bytes[] = nameString.getBytes(); int n = Math.min(name.length, bytes.length); System.arraycopy(bytes, 0, name, 0, n); }
java
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) || Charac...
java
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)); ...
java
public static String stringFor(int m) { switch (m) { case cudaResViewFormatNone :return"cudaResViewFormatNone"; case cudaResViewFormatUnsignedChar1 :return"cudaResViewFormatUnsignedChar1"; case cudaResViewFormatUnsignedChar2 ...
java
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 : retur...
java
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; }
java
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; }
java
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_PROG...
java
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_ATTRIBUT...
java
public static String stringFor(int k) { switch (k) { case cudaMemcpyHostToHost: return "cudaMemcpyHostToHost"; case cudaMemcpyHostToDevice: return "cudaMemcpyHostToDevice"; case cudaMemcpyDeviceToHost: return "cudaMemcpyDeviceToHost"; case cudaM...
java
public static String stringFor(int n) { switch (n) { case cudaGraphicsRegisterFlagsNone: return "cudaGraphicsRegisterFlagsNone"; case cudaGraphicsRegisterFlagsReadOnly: return "cudaGraphicsRegisterFlagsReadOnly"; case cudaGraphicsRegisterFlagsWriteDiscard: r...
java
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 : retu...
java
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...
java
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; }
java
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_COM...
java
private static void loadLibraryResource( String resourceSubdirectoryName, String libraryName, String tempSubdirectoryName, String ... dependentLibraryNames) throws Throwable { // First try to load all dependent libraries, recursively for (String dependentLibrar...
java
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 (!tempSubDirector...
java
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);...
java
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; ...
java
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"; ...
java
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 ...
java
public static String stringFor(int n) { switch (n) { case cudaGraphicsCubeFacePositiveX: return "cudaGraphicsCubeFacePositiveX"; case cudaGraphicsCubeFaceNegativeX: return "cudaGraphicsCubeFaceNegativeX"; case cudaGraphicsCubeFacePositiveY: return "cudaGraph...
java
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_R...
java
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_UNSIG...
java
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; }
java
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_...
java
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: retu...
java
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_...
java
public static String stringFor(int n) { switch (n) { case cudaLimitStackSize: return "cudaLimitStackSize"; case cudaLimitPrintfFifoSize: return "cudaLimitPrintfFifoSize"; case cudaLimitMallocHeapSize: return "cudaLimitMallocHeapSize"; case cudaL...
java
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"; ...
java
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 : ret...
java
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_T...
java