updating
This commit is contained in:
21
workloads/aes_ccm.c
Normal file
21
workloads/aes_ccm.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main() {
|
||||
printf("[aes_ccm] Starting AES-CCM encryption workload...\n");
|
||||
volatile unsigned char data[1024];
|
||||
volatile unsigned char key[16] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
|
||||
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10};
|
||||
|
||||
for (int round = 0; round < 1000000; round++) {
|
||||
// Simulate AES-like operations
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
data[i] = (data[i] ^ key[i % 16]) + (round & 0xFF);
|
||||
}
|
||||
if (round % 200000 == 0) {
|
||||
printf("[aes_ccm] progress: %d rounds\n", round);
|
||||
}
|
||||
}
|
||||
printf("[aes_ccm] Done! final byte=%d\n", data[0]);
|
||||
return 0;
|
||||
}
|
||||
23
workloads/attention_kernel.c
Normal file
23
workloads/attention_kernel.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
int main() {
|
||||
printf("[attention_kernel] Starting attention mechanism workload...\n");
|
||||
volatile double attention[64][64];
|
||||
volatile double sum = 0.0;
|
||||
|
||||
for (int iter = 0; iter < 500000; iter++) {
|
||||
// Simulate attention computation
|
||||
for (int i = 0; i < 64; i++) {
|
||||
for (int j = 0; j < 64; j++) {
|
||||
attention[i][j] = sin(i * 0.1) * cos(j * 0.1) + iter * 0.001;
|
||||
sum += attention[i][j];
|
||||
}
|
||||
}
|
||||
if (iter % 100000 == 0) {
|
||||
printf("[attention_kernel] progress: %d iterations\n", iter);
|
||||
}
|
||||
}
|
||||
printf("[attention_kernel] Done! sum=%f\n", sum);
|
||||
return 0;
|
||||
}
|
||||
15
workloads/sensor_fusion.c
Normal file
15
workloads/sensor_fusion.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
int main() {
|
||||
printf("[sensor_fusion] Starting sensor fusion workload...\n");
|
||||
volatile double sum = 0.0;
|
||||
for (int i = 0; i < 15000000; i++) {
|
||||
sum += sqrt(i * 0.001) * log(i + 1);
|
||||
if (i % 3000000 == 0) {
|
||||
printf("[sensor_fusion] progress: %d iterations\n", i);
|
||||
}
|
||||
}
|
||||
printf("[sensor_fusion] Done! sum=%f\n", sum);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user