@Override public Accumulation execAndReturn(Accumulation op) { return (Accumulation) exec(op); }
@Override public void printEnvironmentInformation() { Properties env = getEnvironmentInformation(); double memory = ((Long) env.get("memory.available")) / (double) 1024 / 1024 / 1024; String fm = String.format("%.1f", memory); log.info("Backend used: [{}]; OS: [{}]", env.get("backend"), env.get("os")); log.info("Cores: [{}]; Memory: [{}GB];", env.get("cores"), fm); log.info("Blas vendor: [{}]", env.get("blas.vendor")); }
@Override public INDArray bitmapEncode(INDArray indArray, double threshold) { DataBuffer buffer = Nd4j.getDataBufferFactory().createInt(indArray.length() / 16 + 5); INDArray ret = Nd4j.createArrayFromShapeBuffer(buffer, indArray.shapeInfoDataBuffer()); bitmapEncode(indArray, ret, threshold); return ret; }
@Override public void iterateOverAllColumns(Op op) { if (op.x().isVector()) { exec(op); exec(op, 1); } else { if (op.x() instanceof IComplexNDArray) { if (y != null) op.setY(y.getColumn(i)); iterateOverAllColumns(op); if (y != null) op.setY(y.getColumn(i)); iterateOverAllColumns(op);
op.setY(op.y()); op.setZ(op.z()); exec(op); if (y != null) op.setY(y.slice(i)); exec(op); originalZ.slice(i).assign(op.z()); if (y != null) op.setY(y.getRow(i).dup()); exec(op); zRow.assign(op.z()); op.setX(slice); op.setZ(zSlice); iterateOverAllRows(op);
@Override @SuppressWarnings("unchecked") public void printEnvironmentInformation() { super.printEnvironmentInformation(); Properties env = getEnvironmentInformation(); List<Map<String, Object>> devicesList = (List<Map<String, Object>>) env.get(Nd4jEnvironment.CUDA_DEVICE_INFORMATION_KEY); for (Map<String, Object> dev : devicesList) { log.info("Device Name: [{}]; CC: [{}.{}]; Total/free memory: [{}]", dev.get(Nd4jEnvironment.CUDA_DEVICE_NAME_KEY), dev.get(Nd4jEnvironment.CUDA_DEVICE_MAJOR_VERSION_KEY), dev.get(Nd4jEnvironment.CUDA_DEVICE_MINOR_VERSION_KEY), dev.get(Nd4jEnvironment.CUDA_TOTAL_MEMORY_KEY)); } }
public long profilingHookIn(CustomOp op) { switch (profilingMode) { case ALL: OpProfiler.getInstance().processOpCall(op); break; case METHODS: break; case OPERATIONS: OpProfiler.getInstance().processOpCall(op); break; case SCOPE_PANIC: checkForWorkspaces(op); return 0L; case DISABLED: default: return 0L; } return System.nanoTime(); }
protected void checkWorkspace(String opName, INDArray array) { if (array.isAttached()) { val ws = array.data().getParentWorkspace(); if (ws.getWorkspaceType() != MemoryWorkspace.Type.CIRCULAR) { if (!ws.isScopeActive()) { throw new ND4JIllegalStateException("Op [" + opName + "] X argument uses leaked workspace pointer from workspace [" + ws.getId() + "]\nAll open workspaces: " + allOpenWorkspaces() + "\n" + SCOPE_PANIC_MSG); } if (ws.getGenerationId() != array.data().getGenerationId()) throw new ND4JIllegalStateException("Op [" + opName + "] X argument uses outdated workspace pointer from workspace [" + ws.getId() + "]\nAll open workspaces: " + allOpenWorkspaces() + "\n" + SCOPE_PANIC_MSG); } } }
@Override public void iterateOverAllColumns(Op op) { if (op.x().isVector()) { exec(op); exec(op, 1); } else { if (op.x() instanceof IComplexNDArray) { if (y != null) op.setY(y.getColumn(i)); iterateOverAllColumns(op); if (y != null) op.setY(y.getColumn(i)); iterateOverAllColumns(op);
op.setY(op.y()); op.setZ(op.z()); exec(op); if (y != null) op.setY(y.slice(i)); exec(op); originalZ.slice(i).assign(op.z()); if (y != null) op.setY(y.getRow(i).dup()); exec(op); zRow.assign(op.z()); op.setX(slice); op.setZ(zSlice); iterateOverAllRows(op);
@Override @SuppressWarnings("unchecked") public void printEnvironmentInformation() { super.printEnvironmentInformation(); Properties env = getEnvironmentInformation(); List<Map<String, Object>> devicesList = (List<Map<String, Object>>) env.get(Nd4jEnvironment.CUDA_DEVICE_INFORMATION_KEY); for (Map<String, Object> dev : devicesList) { log.info("Device name: [{}]; CC: [{}.{}]; Total/free memory: [{}]", dev.get(Nd4jEnvironment.CUDA_DEVICE_NAME_KEY), dev.get(Nd4jEnvironment.CUDA_DEVICE_MAJOR_VERSION_KEY), dev.get(Nd4jEnvironment.CUDA_DEVICE_MINOR_VERSION_KEY), dev.get(Nd4jEnvironment.CUDA_TOTAL_MEMORY_KEY)); } }
public long profilingHookIn(Op op) { switch (profilingMode) { case ALL: OpProfiler.getInstance().processOpCall(op); break; case METHODS: break; case OPERATIONS: OpProfiler.getInstance().processOpCall(op); break; case SCOPE_PANIC: checkForWorkspaces(op); return 0L; case DISABLED: default: return 0L; } return System.nanoTime(); }
@Override public IndexAccumulation execAndReturn(IndexAccumulation op) { return (IndexAccumulation) exec(op); }
@Override public void printEnvironmentInformation() { Properties env = getEnvironmentInformation(); double memory = ((Long) env.get("memory.available")) / (double) 1024 / 1024 / 1024; String fm = String.format("%.1f", memory); log.info("Backend used: [{}]; OS: [{}]", env.get("backend"), env.get("os")); log.info("Cores: [{}]; Memory: [{}GB];", env.get("cores"), fm); log.info("Blas vendor: [{}]", env.get("blas.vendor")); }
@Override public INDArray bitmapEncode(INDArray indArray, double threshold) { DataBuffer buffer = Nd4j.getDataBufferFactory().createInt(indArray.length() / 16 + 5); INDArray ret = Nd4j.createArrayFromShapeBuffer(buffer, indArray.shapeInfoDataBuffer()); bitmapEncode(indArray, ret, threshold); return ret; }
/** * Execute and return the result from a vector op * * @param op */ @Override public INDArray execAndReturn(ShapeOp op) { exec(op); return op.z(); }
public synchronized Properties getEnvironmentInformation() { if (properties == null) { Properties props = super.getEnvironmentInformation();
@Override public INDArray exec(Variance accumulation, boolean biasCorrected, int... dimension) { accumulation.setBiasCorrected(biasCorrected); return exec(accumulation, dimension); }
public synchronized Properties getEnvironmentInformation() { if (properties == null) { Properties props = super.getEnvironmentInformation();
@Override public INDArray execAndReturn(TransformOp op) { Op result = exec(op); TransformOp t = (TransformOp) result; return t.z(); }