Skip to content

Conversation

@yufenglee
Copy link
Member

Description

Motivation and Context

int32_t k = k_block_idx * block_size;
const BlockwiseQuantBlock<T, block_size, bits>* blob_ptr = src_blob + task_idx;
if (nullptr != zero_points) {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], zero_points[task_idx], k, K);

Check warning

Code scanning / PREfast

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
if (nullptr != zero_points) {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], zero_points[task_idx], k, K);
} else {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], k, K);

Check warning

Code scanning / PREfast

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
int32_t k = k_block_idx * block_size;
const BlockwiseQuantBlock<T, block_size, bits>* blob_ptr = src_blob + task_idx;
if (nullptr != zero_points) {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], zero_points[task_idx], k, K);

Check warning

Code scanning / PREfast

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
if (nullptr != zero_points) {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], zero_points[task_idx], k, K);
} else {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], k, K);

Check warning

Code scanning / PREfast

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
int32_t k = k_block_idx * block_size;
const BlockwiseQuantBlock<T, block_size, bits>* blob_ptr = src_blob + task_idx;
if (nullptr != zero_points) {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], zero_points[task_idx], k, K);

Check warning

Code scanning / PREfast

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
if (nullptr != zero_points) {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], zero_points[task_idx], k, K);
} else {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], k, K);

Check warning

Code scanning / PREfast

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
int32_t k = k_block_idx * block_size;
const BlockwiseQuantBlock<T, block_size, bits>* blob_ptr = src_blob + task_idx;
if (nullptr != zero_points) {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], zero_points[task_idx], k, K);

Check warning

Code scanning / PREfast

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
if (nullptr != zero_points) {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], zero_points[task_idx], k, K);
} else {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], k, K);

Check warning

Code scanning / PREfast

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
int32_t k = k_block_idx * block_size;
const BlockwiseQuantBlock<T, block_size, bits>* blob_ptr = src_blob + task_idx;
if (nullptr != zero_points) {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], zero_points[task_idx], k, K);

Check warning

Code scanning / PREfast

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
if (nullptr != zero_points) {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], zero_points[task_idx], k, K);
} else {
blob_ptr->dequant(dst + n * K + k, scale[task_idx], k, K);

Check warning

Code scanning / PREfast

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).

Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).
@yufenglee
Copy link
Member Author

A clean one: #17890

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants