/** * \file src/common.cpp * MegRay is Licensed under the Apache License, Version 2.0 (the "License") * * Copyright (c) 2014-2020 Megvii Inc. All rights reserved. * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */#include "common.h"#include <cstdint>namespaceMegRay{size_tget_dtype_size(DTypedtype){switch(dtype){caseMEGRAY_INT8:caseMEGRAY_UINT8:return1;caseMEGRAY_FLOAT16:return2;caseMEGRAY_INT32:caseMEGRAY_UINT32:caseMEGRAY_FLOAT32:return4;caseMEGRAY_INT64:caseMEGRAY_UINT64:caseMEGRAY_FLOAT64:return8;default:MEGRAY_THROW("unknown dtype");}}}// namespace MegRay