Update module.zig to donate all buffers except the token_index buffer for the Llama+Neuron example.

This commit is contained in:
Tarry Singh 2023-10-06 10:10:56 +00:00
parent 474f76cd75
commit 3bc6ad98be

View File

@ -350,9 +350,6 @@ pub const CompilationContext = struct {
/// Given a list of donations mapping output buffers to input buffers, /// Given a list of donations mapping output buffers to input buffers,
/// generate donation attribute for each `n_args` input argument. /// generate donation attribute for each `n_args` input argument.
fn addDonationsAttributes(self: CompilationContext, attributes: []AttributeList, donations: []const Tensor._Donation) void { fn addDonationsAttributes(self: CompilationContext, attributes: []AttributeList, donations: []const Tensor._Donation) void {
if (self.target() == .neuron) {
return;
}
var n_donations: usize = 0; var n_donations: usize = 0;
for (donations, 0..) |donation, index| { for (donations, 0..) |donation, index| {
switch (donation) { switch (donation) {