MCPcopy Create free account
hub / github.com/Cambricon/mlu-ops / MLUOP_WIN_API mluOpSetQuantizeRoundMode

Function MLUOP_WIN_API mluOpSetQuantizeRoundMode

core/context.cpp:392–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392mluOpStatus_t MLUOP_WIN_API mluOpSetQuantizeRoundMode(
393 mluOpHandle_t handle, mluOpQuantizeRoundMode_t round_mode) {
394 PARAM_CHECK("[mluOpSetQuantizeRoundMode]", handle != NULL);
395 PARAM_CHECK("[mluOpSetQuantizeRoundMode]",
396 round_mode == MLUOP_ROUND_HALF_TO_EVEN ||
397 round_mode == MLUOP_ROUND_HALF_OFF_ZERO ||
398 round_mode == MLUOP_ROUND_HALF_UP);
399 if (handle->arch < 372) {
400 if (round_mode == MLUOP_ROUND_HALF_TO_EVEN) {
401 LOG(ERROR)
402 << "[mluOpSetQuantizeRoundMode] Unsupported rounding mode on MLU200";
403 return MLUOP_STATUS_BAD_PARAM;
404 }
405 }
406
407 handle->round_mode = round_mode;
408
409 return MLUOP_STATUS_SUCCESS;
410}
411
412mluOpStatus_t MLUOP_WIN_API mluOpGetQuantizeRoundMode(
413 mluOpHandle_t handle, mluOpQuantizeRoundMode_t *round_mode) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected