예제 #1
0
void setup()
{
    // Set up serial port for debugging
    Serial.begin(9600);

    while (!Serial)
    {
	; // wait for serial port to connect. Needed for Leonardo only
    }

    // Fullfil the data array
    createDataArray();

    // Read and set the key from the EEPROM
    readKey(KEYLENGTH);

    // Inicialization of the key
    time = micros(); // time start
    aes192_init(key, &key_init);
    emit = micros(); // time start

    Serial.print(F("Inicialisation total takes: "));
    Serial.print(emit - time);
    Serial.println(F(" [us]"));

    // initialize the digital pin as an output.
    // Pin 13 has an LED connected on most Arduino boards:
    pinMode(ledPin, OUTPUT);
}
예제 #2
0
int main(void)
{
    double * data;
    double start, finish;

    data = createDataArray();

#ifndef PREF
    // The branch with no prefetch
    poisonCache();
    printf("Simple start\n");
    start = getTimeInSeconds();
    simpleSumm(data);
    finish = getTimeInSeconds();
    printf("Simple seconds: %f\n", finish - start);
#else
    // The branch with regular prefetch
    poisonCache();
    printf("Prefetch start\n");
    start = getTimeInSeconds();
    prefetchSumm(data);
    finish = getTimeInSeconds();
    printf("Prefetch seconds: %f\n", finish - start);
#endif // PREF

    deleteDataArray(data);
}
예제 #3
0
파일: Block.hpp 프로젝트: wvangeit/nix
    DataArray createDataArray(const std::string &name,
                              const std::string &type,
                              const T &data) {
         const Hydra<const T> hydra(data);
         DataType dtype = hydra.element_data_type();

         const NDSize shape = hydra.shape();
         DataArray da = createDataArray(name, type, dtype, shape);

         const NDSize offset(shape.size(), 0);
         da.setData(data, offset);

         return da;
    }