let data: vec![0u8; 1024];
foo(data.as_ref()); // Passes an immutable slice
fn foo(data: &[u8]) {
...
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdint.h> | |
#include <x86intrin.h> | |
#include "ippcp.h" | |
#include "examples_common.h" | |
#define DATA_SIZE 1024*1024 | |
#define DIGEST_SIZE 32 | |
#define ITERATIONS 10000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read N lines of input, splitting each line and storing the result in a numpy array. | |
import numpy as np | |
a = np.array([input().split() for _ in range(N)], int) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _TIMESTAMP_H_ | |
#define _TIMESTAMP_H_ | |
static inline uint64_t timestamp_start(void) | |
{ | |
union { | |
uint64_t tsc_64; | |
struct { | |
uint32_t lo_32; | |
uint32_t hi_32; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mpps(gbps, size): | |
return (gbps / (size * 8)) * 1000 | |
def gbps(mpps, size): | |
return mpps * size * 8 / 1000; | |
def pkt_size(gbps, mpps): | |
return (gbps * 1000) / mpps / 8 | |
################################################## |
GNU Octave is a high-level interpreted language, primarily intended for numerical computations.
(via GNU Octave)
- not equal
~=
- logical AND
&&