Disable warning

This commit is contained in:
Christopher Taylor 2017-05-29 02:40:08 -07:00
parent 8673889a9a
commit 94bf94771e
5 changed files with 30 additions and 9 deletions

View File

@ -192,6 +192,8 @@ void xor_mem(
} while (bytes > 0);
}
#ifdef LEO_M1_OPT
void xor_mem_2to1(
void * LEO_RESTRICT x,
const void * LEO_RESTRICT y,
@ -255,6 +257,8 @@ void xor_mem_2to1(
} while (bytes > 0);
}
#endif // LEO_M1_OPT
#ifdef LEO_USE_VECTOR4_OPT
void xor_mem4(

View File

@ -322,6 +322,8 @@ void xor_mem(
void * LEO_RESTRICT x, const void * LEO_RESTRICT y,
uint64_t bytes);
#ifdef LEO_M1_OPT
// x[] ^= y[] ^ z[]
void xor_mem_2to1(
void * LEO_RESTRICT x,
@ -329,6 +331,8 @@ void xor_mem_2to1(
const void * LEO_RESTRICT z,
uint64_t bytes);
#endif // LEO_M1_OPT
#ifdef LEO_USE_VECTOR4_OPT
// For i = {0, 1, 2, 3}: x_i[] ^= x_i[]

View File

@ -32,6 +32,10 @@
#include <string.h>
#ifdef _MSC_VER
#pragma warning(disable: 4752) // found Intel(R) Advanced Vector Extensions; consider using /arch:AVX
#endif
namespace leopard { namespace ff8 {

View File

@ -150,7 +150,11 @@ LEO_EXPORT LeopardResult leo_encode(
// Handle m = 1 case
if (recovery_count == 1)
{
EncodeM1(buffer_bytes, original_count, original_data, work_data[0]);
EncodeM1(
buffer_bytes,
original_count,
original_data,
work_data[0]);
return Leopard_Success;
}
@ -251,23 +255,23 @@ LEO_EXPORT LeopardResult leo_decode(
// Check if not enough recovery data arrived
unsigned original_loss_count = 0;
unsigned original_loss_index = 0;
unsigned original_loss_i = 0;
for (unsigned i = 0; i < original_count; ++i)
{
if (!original_data[i])
{
++original_loss_count;
original_loss_index = i;
original_loss_i = i;
}
}
unsigned recovery_got_count = 0;
unsigned recovery_last_i = 0;
unsigned recovery_got_i = 0;
for (unsigned i = 0; i < recovery_count; ++i)
{
if (recovery_data[i])
{
++recovery_got_count;
recovery_last_i = i;
recovery_got_i = i;
}
}
if (recovery_got_count < original_loss_count)
@ -276,14 +280,19 @@ LEO_EXPORT LeopardResult leo_decode(
// Handle k = 1 case
if (original_count == 1)
{
memcpy(work_data[0], recovery_data[recovery_last_i], buffer_bytes);
memcpy(work_data[0], recovery_data[recovery_got_i], buffer_bytes);
return Leopard_Success;
}
// Handle m = 1 case
if (recovery_count == 1)
{
DecodeM1(buffer_bytes, original_count, original_data, recovery_data[0], work_data[original_loss_index]);
DecodeM1(
buffer_bytes,
original_count,
original_data,
recovery_data[0],
work_data[original_loss_i]);
return Leopard_Success;
}

View File

@ -46,10 +46,10 @@ struct TestParameters
unsigned recovery_count = 100; // under 65536 - original_count
#else
unsigned original_count = 3; // under 65536
unsigned recovery_count = 1; // under 65536 - original_count
unsigned recovery_count = 2; // under 65536 - original_count
#endif
unsigned buffer_bytes = 64000; // multiple of 64 bytes
unsigned loss_count = 16; // some fraction of original_count
unsigned loss_count = 2; // some fraction of original_count
unsigned seed = 0;
bool multithreaded = true;
};