Skip to content

Can someone explain how the memory is allocated for alpha, beta and log_probs2? #94

@ronggong

Description

@ronggong

alphas = reinterpret_cast<ProbT *>(static_cast<char *>(workspace) + bytes_used);

Hi,

I am looking for an explanation of L103 to L110. Afaiu, workspace is the expected memory size to allocate for all batch, see below code:

*size_bytes = per_minibatch_bytes * minibatch;

and byte_used is the allocated memory size. I could not understand, why in the code, we allocate workspace + byte_used memory size for alpha, beta and log_probs2? The reason, from my understanding, workspace is already the memory size for the entire batch, so the allocation here is redundant?

Cheers,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions